Django Admin Search FILTER_ERROR
See original GitHub issueWhen using django-ldapdb and using the search form in the admin page, a FILTER_ERROR occurs.
Search Fields defined in admin.py:
class LdapGroupAdmin(admin.ModelAdmin):
exclude = ['dn', 'password', 'photo']
list_display = ['cn', 'gidNumber', 'mumberUid']
search_fields = ['gidNumber',]
admin.site.register(models.LdapGroup, LdapGroupAdmin)
The following error occurs:
FILTER_ERROR at /ldapdb/admin/ldapapi/ldapgroup/
{'desc': u'Bad search filter'}
The search filter being sent to pyldap appears to be:
'(&(objectClass=top)(objectClass=posixGroup)(ldapapi_ldapgroup.gidNumber LIKE %959959%))',
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Django Admin Filter and Search Fields Not Working
I want to be able to add new Author and Narrator objects and search through these fields. This stopped working after the form...
Read more >How to filter and search on the Django admin page
The Django admin page is very useful if you are looking to search or filter the various aspects of your project. For large-scale...
Read more >Doing text lookup for a ModelChoiceField on Admin gets ...
Needed to change the search_fields using a custom get_search_results and also use the other fields/list results #admin.py class SomeModelAdmin(admin.
Read more >shinneider/django-admin-search: Modal filter for ...
The "Django Admin Search" is a advanced search modal for django admin. If you use or like the project, click Star and Watch...
Read more >ModelAdmin List Filters
A 2-tuple containing a field name and a subclass of django.contrib.admin. ... Field names in list_filter can also span relations using the __...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue cleaning: I’m closing this one (no activity for 1+ year), feel free to reopen it if you still have issues!
Fixed in https://github.com/django-ldapdb/django-ldapdb/pull/152
in ldapdb/models/fields.py we should register IContains to ListField (and MultiValueField too):
ListField.register_lookup(IContainsLookup)
Fixed, it works