On 19/02/10 08:32, Le Quoc Viet wrote:
Hi Tim,

Thanks for reply. I mean if I want Samurai to be out of all rooms?
ForeignKey disallows Null.

minor point - ForeignKey(null=True, blank=True) will merrily allow null if your database allows nullable foreign keys at all (chances are it does). It's frowned upon by relational purists, mind (null in general is, as is sql itself sometimes). I am nonetheless kind of accustomed to it: It is particularly handy when using "null" for "information not filled in yet" in a record you haven't made into N separate tables as enthusiastically as one "should" - do an initial save with fields mostly null, allow user to edit draft until all required fields are gathered, then allow final submit.

> Should I do like this: Create a default dummy
> Room and assign it by default?
>

Well, that might in fact be far better than using Null.  You could
call it "Outside"...

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to