I have these models:
class Entity(models.Model): name=models.CharField(max_length=100) class Theme(models.Model): name=models.CharField(max_l
I actually prefer to do it in get_form like so:
get_form
class CompanyAdmin(admin.ModelAdmin): def get_form(self, request, obj=None, **kwargs): form = super(CompanyAdmin, self).get_form(request, obj, **kwargs) form.fields['theme'].queryset = Theme.objects.filter(name__iexact='company') return form