You can use the following commands to use formfield_for_foreignkey instead of Django Foreingkey limit_choices_to.
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == "dc_layer":
kwargs["queryset"] = DataCenterLayers.objects.filter(datacenter_mission__mission_name='Firewall')
return super().formfield_for_foreignkey(db_field, request, **kwargs)
Türkiye location You can click for our high-performance virtual servers.
You have examined the knowledge base in detail, but if you cannot find the information you need,
Create a Support Ticket