1👍
Django has support for limit_choices_to
in foreign key relations.
https://docs.djangoproject.com/en/4.1/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to
This field can accept callable as per example in the documentation. Version 3.9.1 is supposed to support this attribute: https://www.django-rest-framework.org/community/release-notes/#391
In my opinion, your solution would be to use callable on limit_choices_to attribute on the model filed, that will limit the choices to your needs.
https://www.youtube.com/watch?v=fyIPAoq80tY – this might also help you.
Source:stackexchange.com