New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with ChoiceFiter and ManyToOneRel #30
Comments
I've got the same problem. The relevant part of my trivial test model:
My Filter:
Without the |
This other issue looks relevant, but I can't get to a dev box to try it out right now: |
I have a functional branch which attempts to address this: When a FilterSet is instantiated, it normally adds the defined model to each filter. I've added a loop over the declared filters which are a ChoiceFilter, MultipleChoiceFilter, ModelChoiceFilter or ModelMultipleChoiceFilter and added choices (extracted the same way they are for the undeclared filters) if they don't already have choices. |
Hi,
while trying to use django-filter in a project of mine I got stuck when I wanted to customize a FilterSet (i.e. provide a lookup type). Once I define a custom filter it loses the choices.
I tried to figure it out by myself, but unfortunately the metaprogramming prevented me from doing so.
This works:
This doesn't (The language choices aren't displayed):
Using ModelChoiceFilter doesn't (seem to) work either - it complains about
missing keyword somewhere.
Relevant parts of the test application:
The text was updated successfully, but these errors were encountered: