Skip to content

Hardcoded filter in multi-value dependend fields #80

@tyctor

Description

@tyctor

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

this line:

f"{model_field_name}__in": self.request.GET.getlist(

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

Activity

codingjoe

codingjoe commented on Sep 16, 2021

@codingjoe
Owner

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

added
enhancementNew feature or request
and removed
bugSomething isn't working
on Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Hardcoded filter in multi-value dependend fields · Issue #80 · codingjoe/django-select2