I am looking to make a tree. Each human can have any number of parents and any number of children.
From the command line, I can make arbitrary trees.
But when I use default the web admin interface,
- it won’t let me create a childless human
- it won’t let me delete the last child
It complains
This field is required.
How do I fix this?
from django.db import models
class Human(models.Model):
name = models.CharField('Person', max_length=200)
sons = models.ManyToManyField('self', symmetrical=False,
related_name='fathers')
def __str__(self):
return self.name