David Reynolds

Welcome to boredom

I Wonder...

| Comments

Why do apple pies come in green trays but bilberry pies come in yellow ones?

Tiger... Finally

| Comments

So, I finally managed to get my hands on a copy of OS X Tiger. I’ve been meaning to for quite some time, and finally decided to this month.

Quite impressed so far, although the installer wasn’t quite as straight forward as it made out. Apparently there are only 2 steps:

1) Insert the Mac OS X Install Disc 2) Follow the on screen instructions

Well, they failed to mention that you’ll have to recreate your user as it will mysteriously vanish (maybe this was just me, dunno), but the home directory was still there and once I readded the user, all was well and the disk thrashed about a bit, all was well.

Currently playing with Dashboard. I’m writing this using the WordPressDash widget and also have running Ashley’s UK Travel news widget (which may prove usful over the next few days), the dictionary lookup (always useful) and the Weather applet (which shows me that the temperature is currently -6C!).

I’m rather liking the Wordpress widget and it may persuade me to blog more often when it’s so simple to get to it.

Also quite impressed with Spotlight, it seems that it may well replace QuickSilver for me, if I can get to grips with it, will have to see how it goes.

Anyway, off to watch a Clerks 2 video exclusive over at ign.com.

Django Extending/subclassing a User

| Comments

I’ve been trying for the past day or so to extend the user class in django to allow me to add other fields to the model. After lots of fiddling and help from the guys in #django, I’ve finally come up with something that works, so I thought I’d stick it in here for posterity (and to remind myself how to do it in the future).

Basically, you need to do the following in your model (sorry for lack of indentations)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from django.core import meta
# following line is vital
from django.models.auth import *

# Create your models here.
class User(users.User):
      # add your custom fields here...
  section = meta.CharField(maxlength=200)
  
  class META:
           # These 2 lines are vital they are what actually make this model replace the normal user model
      replaces_module = 'auth.users'
      module_name = "users"
           # The rest of this stuff is then copied directly from the User model with with additions for your extra fields
      verbose_name = _('User')
      verbose_name_plural = _('Users')
      module_constants = {
          'SESSION_KEY': '_auth_user_id',
      }
      ordering = ('username',)
      exceptions = ('SiteProfileNotAvailable',)
      admin = meta.Admin(
          fields = (
              (None, {'fields': ('username', 'password')}),
              (_('Personal info'), {'fields': ('first_name', 'last_name', 'email')}),
              (_('Permissions'), {'fields': ('is_staff', 'is_active', 'is_superuser', 'user_permissions')}),
              (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
              (_('Groups'), {'fields': ('groups',)}),
              (_('Sections'), {'fields': ('section',)})
          ),
          list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff'),
          list_filter = ('is_staff', 'is_superuser'),
          search_fields = ('username', 'first_name', 'last_name', 'email'),
      )

and now the vital part…. do NOT try to install this model from whatever app you have created it in, it won’t work. I tried countless times to make it work before it was pointed out that what I actually needed to do was this:

1
python manage.py sqlreset auth | mysql $db

Obvious, when you think about it, huh?

Now it’s all pretty much working, the only remaining issue is that..

1
python manage.py createsuperuser

..does not work. This isn’t the end of the world, but if anyone has any thoughts, I’d be very pleased to hear them.

Myspace

| Comments

Can someone please explain the point of myspace to me? I’m not even going to credit it with a link, as it doesn’t deserve it. OK, so it’s so a social networking site, but what actual purpose does it have? I really can’t see the point of putting another set of your contact details online for some kind spammer to harvest just to show that a bunch of random people are linked to you, isn’t the internet a small place?

People seem to use myspace as a way to keep in touch with people, surely there are better ways than by going to stupidly slow website and entering it in a form? Well, yes, in fact there is. It’s called email. Use it people.

So, who’s with me, let’s boycott myspace!

This rant was brought to you by: Family Guy: Stewie’s Guide to World Domination and the letter V. STOP MOCKING ME!

New Fishies

| Comments

Having bought a new pump for our fish tank last week, we decided to get some new fishies today.

We got 6 Neon tetras, which are quite small fish that live in shoals (hence getting 6) and a Algae-eating Loach which will help to keep the tank clean (hopefully). I will try and attempt to take some pictures of our actual fish when the time is up to turn the light on.

Where'd My Post Go?

| Comments

I made a post the other day (on my birthday, I think) that seems to have gone missing :|

Anyway, on my birthday, having the day off, Becca and I went out for lunch to Old Orleans (who incidently do the best ribs) and then went to watch Walk the line. Fantastic film, about Johnny Cash’s life. On the previous night, I watched a documentary on TV about Johnny Cash, which focused very much on his religion and how, to get off of drugs, he went into a cave and spoke to god. I found it quite odd that in the film his religion was barely mentioned, not that this detracted from my enjoyment, tis just odd.

Back to work on Tuesday to a 5 hour meeting that was organised in my absence (cheers) and to find we have a new person working with us. Busy, Busy, Busy today and yesterday, but I have almost managed to finish my first project in Django, which has been quite fun and actually fairly quick (it is a fairly simple project to be fair though).

Bleh, off to watch TV.

Telling OS X Which Wireless Networks to Trust

| Comments

Huzzah!

I’ve been looking for this option for ages, and I just stumbled upon it. You can make OS X connect automatically to wireless networks that it trusts, this is good and quite useful, but somehow I’d managed to stop it from trusting my home network, meaning I had to manually click the network everytime I want to connect, until now.

The option is under System Preferences > Network > Airport.

Alter By default, join ‘Automatic’ to ‘A specific network’ and tell it which network and the wepkey and you’re away!

Yay!