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?
to your account
When using DjangoFilterBackend (might happen with other backends too but I didn't get a chance to test it) and crispy forms is installed, filter forms have no Submit button.
See attached screenshot:
The text was updated successfully, but these errors were encountered:
@nanuxbe thanks for the report. Do you have some sample project we could test against ? If not I'll set one up.
Sorry, something went wrong.
@xordoquy this is highly pre-alpha but I just pushed https://bitbucket.org/levit_scs/djember_back, this is the project the screenshot is taken from. It is tested under python 3.5 (which I didn't mention in the initial report)
The only api implementing filters so far is available at http://localhost:8000/api/v1/postalcodes/
@nanuxbe thanks a lot, will look at this today
@nanuxbe So the problem here is that PostalCodeFilter inherits from django_filters.FilterSet instead of rest_framework.filters.FilterSet.
@tomchristie @xordoquy should people inherit instead from rest_framework.filters.FilterSet if they want their filter forms in HTML views?
@jpadilla thanks 😄
If inheriting from rest_framework.filters.FilterSet is the way to go then the documentation here needs to be updated.
The Crispy Forms FormHelper is not set on the form for a django_filters.FilterSet subclass. (This is what rest_framework.filters.FilterSet does.)
But the selected template assumes that a FormHelper will be present if crispy forms is installed. We could make that check at runtime when rendering the form
Merge pull request #3787 from Cheglader/issue_3636
Initial fixes #3636 and fixes #3637
No branches or pull requests