1👍
Newer versions of django have a security feature which prevents lookups on related models.
The workaround can be found on this question:
Django: Filtering by %filter% not allowed
1👍
You cannot specify which of the fields will be searched in the query parameter of the URL. Your URL should look like this:
http://{VIEW_URL}?q=ADAM
This will search in both contact__first_name and contact__last_name fields, since those are the fields specified by the *search_field* attribute of your view.
You can have a look at the get_queryset method of the SearchableListMixin class to see how the query is parsed and of the class handles both the query parameter and the search fields.
👤JSTL
- [Answered ]-Django 1.7.1: Child model, remove all references to parent model and make child model inherit from grandpa instead
- [Answered ]-Django – Display images in template using for loop
- [Answered ]-Django 1.10 error, 'NoneType' object is not callable
- [Answered ]-Django RegexValidator does not display message
- [Answered ]-Django: Why is my jQuery POST url changing when it hits the server?
Source:stackexchange.com