Re: Django Admin page says a ForeignKey("self", null=True) field is required

2007-09-13 Thread Martin Taylor
Found the solution myself: It seems that you must have both "null=True" and "blank=True" to get the desired behavior of "not required" for the "Parent" field. My modified model has this line now: Parent = models.ForeignKey("self", null=True, blank=True, verbose_name="ParentFolder") On Sep 13,

Re: Django Admin page says a ForeignKey("self", null=True) field is required

2007-09-13 Thread James Bennett
On 9/13/07, Martin Taylor <[EMAIL PROTECTED]> wrote: > Obviously the first folder in the folder tree, or any top level > folder, will not have a Parent. I don't really want to create an > artificial top level Parent like "root". Any explanation of why this > is happening and what to do to fix it

Django Admin page says a ForeignKey("self", null=True) field is required

2007-09-13 Thread Martin Taylor
I've created a very simple Django app to model a tree (like a file system directory tree). Here's the model.py file: from django.db import models # # Define constants used to control sizes of DB fields # MAX_NAME = 100 # Maximum size of an object's Name field # # Create your models here. # cla