I am creating my very own Group model I am not mentioning towards the builtin Group model. I would like each hroup to become a person in another group (it's parent), but there's the main one "top" group that does not possess a parent group.

The admin interface will not allow me to produce a group without entering a parent or gaurdian. I recieve the mistake personnel_group.parent_id may not be NULL. My Group model appears like this:

class Group(models.Model):
    name = models.CharField(max_length=50)
    parent = models.ForeignKey('self', blank=True, null=True)
    order = models.IntegerField()
    icon = models.ImageField(upload_to='groups', blank=True, null=True)
    description = models.TextField(blank=True, null=True)

How do i make this happen?


I produced the database before I added blank=True, null=True towards the parent area definition. syncdb can't cope with that kind of change, so Django wasn't obtaining on my small changes.

I erased my database and let syncdb create another also it labored fine.