I create my own model Group ; I do not mean the built-in Group model. I want each group to be a member of another group (itβs the parent), but there is one βtopβ group that does not have a parent group.
The admin interface will not allow me to create a group without entering a parent. I get the error personnel_group.parent_id may not be NULL . My Group model is as follows:
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 can i do this?
Thanks.
Greg source share