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

JET_CHANGE_FORM_SIBLING_LINKS not filtering the queryset based on preserved_filters

Open sandro-salles opened this issue 7 years ago • 1 comments

Guys,

I've found that the sibling navigation is currently ignoring preserved_filters when the _changelist_filters are present in the request.GET QueryDict.

apparently the try/except block at line 219 of jet/utils.py always raises a IncorrectLookupParameters exception saying IncorrectLookupParameters: MODEL has no field named u'_changelist_filters.

I managed to "solve" this issue with a workaround by monkey patching get_model_queryset and mutating the request.GET QueryDict before reaching the exception as follows:

if not request.GET._mutable:
    request.GET._mutable = True

request.GET = QueryDict(changelist_filters)

I know, probably not the best approach :/ But at least the thing is working for now.

It would be nice if you could take a look into this!

By the way, i'm using Django Jet version 1.0.6 / Django 1.9.7 / Python 2.7.2

Thanks Sandro Salles

sandro-salles avatar Dec 08 '17 01:12 sandro-salles

This problem has not yet been solved.

Thanks Sandro!

souzagilson15 avatar Jul 13 '20 18:07 souzagilson15