Suppose I have the following two models task
and person
.
Now each person
can have multiple tasks (one to many relationship).
Now in the admin app for a person I can only add one foreign key per record thus I'll have to create multiple records for a person
having a different task
but the same email
and name
fields.
Is there anything I can do in personAdmin
that would allow me to add multiple foreign keys
for the same person and in the backend it would create multiple records ?
class task(models.Model):
description = models.CharField(max_length=100)
class person(models.Model):
task = models.ForeignKey(Author, on_delete=models.CASCADE)
email =models.CharField(max_length=100)
name = models.CharField(max_length=100)
class personAdmin(admin.ModelAdmin):
pass