[Fixed]-How to filter against multiple values for ForeignKey using DjangoFilterBackend

1👍

✅

However if I actually pass this url it returns rows that filters against last parameter value

This is because ForeignKey fields default to ModelChoiceFilter, which just takes a single value from the GET QueryDict.

If you declare your fields as ModelMultipleChoiceFilter they will take the list of values you require.

Leave a comment