[Answer]-Django Foreign Key Filter

1👍

Use the limit_choices_to parameter to ForeignKey:

mechanic = models.ForeignKey(Staff, limit_choices_to={'staff_role': 'M'})
👤mipadi

Leave a comment