Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Allow HTML to render when no filter_class is defined.#3560
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Previously it required a filter_class,or else it would error when calling `cls()`.This now sets the `filter` context to `None`if one does not exist.Fixesencode#3559
4ef5301 to378d6a1Compareericholscher commentedOct 28, 2015
Not sure what the best way to test this is, happy to add tests if someone points the way. |
rest_framework/filters.py Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As a general note/nitpick can we go ahead and also make this look like thefilter_query() method on top, basically just renamingcls forfilter_class.
jpadilla commentedOct 28, 2015
@ericholscher thanks for putting this together, looks good to me. We were already doing a similar check on the |
jpadilla commentedOct 28, 2015
@ericholscher also I'm wondering what does that rendered HTML looks like with no filter sincebothfilter templates use |
lovelydinosaur commentedNov 2, 2015
An example, along with screenshots demonstrating the behavior in the |
lovelydinosaur commentedNov 4, 2015
Gonna accept this for now, given bug fix nature of the 3.3.1 release. |
Allow HTML to render when no filter_class is defined.
Previously it required a filter_class,
or else it would error when calling
cls().This now sets the
filtercontext toNoneif one does not exist.
Thisfixes#3559