django-jazzmin icon indicating copy to clipboard operation
django-jazzmin copied to clipboard

Support for django-admin-numeric-filter (feature)

Open hwalinga opened this issue 5 years ago • 4 comments

Django-admin-numeric-filter (https://github.com/lukasvinclav/django-admin-numeric-filter) adds support for adding range filters on your lists with some nice sliders.

However when using this with django-jazzmin you are greeted with:

....azzmin/templatetags/jazzmin.py", line 234, in jazzmin_list_filter            
query_string = choice["query_string"][1:]                                                
KeyError: 'query_string'                                                                            

This works without problems in the default admin.

I think jazzmin makes assumptions about how filters work which is broken by django-admin-numeric-filter.

Would be nice if the page does not break and maybe the range slider box needs some jazz.

hwalinga avatar Oct 30 '20 22:10 hwalinga

When i look into the search and filter fields implementation, i feel like it needs reshuiffling, i think its drifted away from djangos implementation too much, to fix this issue, i think we would rework the search_form.html include in change_list.html, and if possible, do away with the jazzmin_list_filter

The fastest way for us to provide a fix in for this, is to do the following:

  1. Fork the project and make a new branch
  2. Integrate this 3rd party app into our embedded demo app (https://github.com/farridav/django-jazzmin/tree/master/tests/test_app)
  3. push it up and send us a link to the branch

This way we will be able to reproduce the issue quickly, and fix it, without needing to delve into how to integrate/setup the 3rd party app :)

Thanks for reporting, we hope to provide compatibility with all other packages, especially if they are widely used

farridav avatar Dec 02 '20 09:12 farridav

I created a branch where I integrated the 3rd party app. See PR.

Good news: It just works now, but only needs some styling.

hwalinga avatar Jan 18 '21 16:01 hwalinga

Bump as django-admin-numeric-filter is still missing styling.

arneatec avatar Jul 02 '21 11:07 arneatec

I'm afraid I'm finding it very difficult to put time in to this at the moment, so anybody that wants to add to the PR, and get it code complete, please do.

I hope to have more time in a month or so, but until then, I'll need contributors

farridav avatar Jul 02 '21 17:07 farridav