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

Hardcoded filter in multi-value dependend fields

Open tyctor opened this issue 4 years ago • 1 comments

I think, that is not good idea to hardcode filter used in dependent field to filter queryset

this line: https://github.com/codingjoe/django-select2/blob/bfc9313af4a738ca22580dc124916f9c4b0a4c5e/django_select2/views.py#L57

is adding this hardcoded filter __in

but in my use case i need another filter to be used - __has_any_keys to query postgress JSONField so better will be to let user to choose kind of filter in widget initialization, instead of hardcode __in

tyctor avatar Sep 03 '21 13:09 tyctor

Hi @tyctor,

You have a point. However, this package is supposed to work in most, but not all cases out of the box. If you have a good solution, please share. If not, we maybe just need to improve the documentation, to help people override the function.

Best Joe

codingjoe avatar Sep 16 '21 11:09 codingjoe