Disable add of related record in Django admin

20 Views Asked by At

I would like to customize a Django 5+ admin view page. The model looks like this

class Person
    tutor = models.ForeignKey("Person", on_delete=models.SET_NULL, null=True, blank=True)

and consequently the edit page for Person has a drop down box to select from a list of already added persons to the database, and add and delete buttons. Is there a way to remove (or disable) these add and delete buttons so that only Persons added before can be selected used? But I do not want to disable adding Persons in general, I just want that it cannot be done through this button.

0

There are 0 best solutions below