On Saturday 10 June 2006 16:46, Todd O'Bryan wrote:

> On Jun 10, 2006, at 11:41 AM, Justin wrote:
> > I was following the Model Ex. 11 "Relating an object to itself,
> > many-to-one" in an attempt to create nested containers. I'm running
> > into the problem that at the start there is no parent for newly
> > created
> > objects to relate too. Is there a way to handle this from the Model
> > or do I need to just fire an INSERT after syncdb to create that
> > first object so that the other objects have something to relate
> > too?
>
> Could you use null=True (or is it blank=True, I get confused) to make
> the relationship optional?

It's 'null=True' -- you need that column in the db to allow NULLs.  You 
also need blank=True if you are going to use the admin or 
AutomaticManipulators.

Luke

-- 
The probability of someone watching you is proportional to the 
stupidity of your action.

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to