Re: Admin interface for model with optional 'self' relationship

2010-07-02 Thread Jonathan Hayward
Thank you! Solved. On Mon, Jun 28, 2010 at 4:14 PM, Jeff Green wrote: > You need to also state that null=True. Also, you want to have ensure that > the field defined in your db > allows null values. > > On Mon, Jun 28, 2010 at 3:19 PM, Jonathan Hayward < > christos.jonathan.hayw...@gmail.com> wr

Re: Admin interface for model with optional 'self' relationship

2010-06-28 Thread Jeff Green
You need to also state that null=True. Also, you want to have ensure that the field defined in your db allows null values. On Mon, Jun 28, 2010 at 3:19 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I have a model with two foreign keys to itself: > > department = models.

Admin interface for model with optional 'self' relationship

2010-06-28 Thread Jonathan Hayward
I have a model with two foreign keys to itself: department = models.ForeignKey(u'self', blank = True, related_name = u'member') reports_to = models.ForeignKey(u'self', blank = True, related_name = u'subordinate') When I tried to save test data from the admin interface, leaving those items