Here is the code : class Category(models.Model): parent = models.ForeignKey('self', blank=True, null=True) name = models.CharField(max_length=63) def __unicode__(self): return self.name
I don't understand why but when I create a category in the admin page, there is this error : Exception Type: IntegrityError Exception Value: commercial_category.parent_id may not be NULL I try to make the parent ForeignKey optional but it doesn't work Thanks for you help --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---