Re: ForeignKey with 0 meaning Null

2008-07-07 Thread rui
Nick, Maybe only your print isnĀ“t working. Look at this class: http://code.djangoproject.com/browser/django/trunk/django/db/models/fields/__init__.py#L982 If you really want to check if it is working, do: fp = open("/writable/path/to/log.txt", "w") class

ForeignKey with 0 meaning Null

2008-07-07 Thread Nick Craig-Wood
I'm adapting a legacy database for use with Django and I've come across a problem I haven't been able to solve! The database has ForeignKey fields which are sometimes 0, meaning there is no related row in the other table. If this database used NULL instead of 0 then I could use