[Solved] dynamic filter choice field in django


So I figured this out, I was passing the plant_number instead of the id, which is what django was expecting since my filter is against the Sightings model and plant_number is a foreign key in the the Sightings model. The code that worked:

plant_number = django_filters.ChoiceFilter(choices=[[o.id, o.plant_number + " " + o.Manufacturer] for o in Plant.objects.all().order_by('IMS_plant')])

solved dynamic filter choice field in django