Category: Web Design


OpenID

You can now sign in to leave comments here (yes, dear readers, both of you!) – using an OpenID if you have one, and in related news, I’ve got m’self a shiny new OpenID to go and do likewise on other people’s sites.

Model inheritance in Django

a.k.a. “How to query for all objects not in a given subclass”

I ran across this problem today – do please leave a comment if you know of a better way to solve it than what follows.

You have two Django models, one of which inherits from the other, e.g.:

class Order(models.Model):
    # some fields

class DiningOrder(Order):
    # some more fields

So, how do I write a query (using the Django ORM) which returns all the Orders which are not DiningOrders?

Apparently, this does the trick:

>>> Order.objects.all().count()
762L
>>> DiningOrder.objects.all().count()
93L
>>> Order.objects.exclude(id__in=[d.id for d in DiningOrder.objects.all()]).count()
669L

Introducing Bogroll: a stateless RSS reader

My main problem with RSS readers is that if I go away for a few days and come back, I don’t really have time to catch up with all the posts which came up whilst I was away. What I needed, therefore, was a stateless reader which would just show the newest 10 entries or so.

Add in category filtering and a web interface – such as it is – and you get Bogroll, which I’ve just released under the GPL. You can grab the 0.1 release, check out the code from subversion, and have a nosey at my installation.

Incidentally, if anyone can think of a better name for it, do get in touch.

Asirra, and the end of another term

Spam. It’s not going away, and nor is my increasing annoyance at some of the things we need to do to avoid it. Like making a separate email forwarder for every service I sign up to. Or, like CAPTCHAs. I can see exactly why we need them, but deciphering squiggly letters against a low-contrast background isn’t easy on the eyes. I was intrigued to see a possible alternative solution called Asirra, which Microsoft Research have come up with. Who knows, I might give it a try myself to keep the bots away from my comments section – although Bad Behavior seems to be doing a good job at the moment.

In other news, I appear to have reached the end of another Oxford term with my sanity intact. The first six weeks were great, it just got a bit wearing for the last two. Some of the non-academic stuff, sadly, is going to have to take a back seat after Christmas, but ah well.

So, as those not reading via one of the planets will be aware, I’ve rolled out the fourth (or is it fifth?) new theme for this site since May 2007. I’m definitely more pleased with this one than any of its predecessors, and intend to stick with it for a good while.

In other news, I blew £160 on new technology for my desk this week: specifically, a new 4GB USB pendrive to replace my ailing 256mb one, a 250GB external hard disk for my backups, and best of all, a 19 inch TFT monitor to act as a second screen for my laptop.

All of the above were very reasonably priced over at Dabs, and the £100 inc delivery cost of the monitor in particular came as a very pleasant surprise.

This is the first time I’ve given multiple monitors a serious go under Linux (specifically Kubuntu), and KDE certainly puts Windows (at least up to and including XP) into the shade here: a taskbar on each monitor? Yes, it can do that. Separate background images per monitor (without silly hacks involving stitching image files together)? Yes. Only show the buttons for the windows on this monitor on this monitor’s taskbar? Certainly, sir.

It’s only been two days, but I’m already wondering how I ever managed without a secondary screen. It certainly made finishing the new theme for this site a lot easier.

Two days of CSS

So, I’ve spent the last 48 hours writing a couple of style sheets.

The first one, as the regular readers amongst you will notice, was for this site (apologies to those of you reading this on Planet CompSoc, you’ll have to click through to see what I’m on about). I’ve gone for a minimalist black-and-white look. I’m not entirely happy with it, but I’ll keep tweaking…

The second, still very much in progress, is for the Magdalen College JCR site, which I’m giving a comprehensive makeover this summer. Feel free to leave a comment on either – constructive criticism is always welcome.

Update

Apologies to anyone who visited this site at about 20.40 BST on 27/06/2007 and wondered what the heck had happened to the new theme this post mentioned. Suffice to say that the correct way to fiddle with WordPress is to start in the backend manager, not to do random find-and-replaces across the underlying code. Don’t try and rename the directory the current theme lives in, either.

Up and running

So, after a few weeks of holding pages and messing around, my site is now up, and it’s here to stay. The default WordPress theme certainly isn’t; chances are I won’t have time to make a nice new one until the end of June, though. As some of you may have seen, I had a go, but it ended up being not much better than my first ever attempt at web design, so clearly I need to take the time to do it properly. Watch this space…

Powered by WordPress | Theme: Motion by 85ideas.

Bad Behavior has blocked 61 access attempts in the last 7 days.