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.
#
class Folder(models.Model) :
    """
    This class models the Folder tree.
    """
    #
    # Field definitions
    #
    Parent = models.ForeignKey("self", null=True, verbose_name="Parent
Folder")
    Name   = models.CharField(maxlength=MAX_NAME)
    #
    # Meta options
    #
    class Meta :
        db_table     = "Folder"
    #
    # Admin options
    #
    class Admin :
        pass


When I try to add my first Folder in the Admin pages it says:
 "Please correct the error below.
    * This field is required."
for the Parent field.

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 would be greatly appreciated.


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to