You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe this is not de best title idk if LookupChoiceFilter works in other projects but this is my second day debugging and I can't figure out what is happening.
So recently I migrate to django-filter 2.2.0 from version 1. I read that i have to change "The Filter.lookup_expr argument no longer accepts None or a list of expressions. Use the LookupChoiceFilter instead.", so i did it but now i can't filter any more.
I'm using django=2.2.16 and django-rest=3.12.1
I have two models in django
Models
------
class A:
date = datefield
pass
Class B:
a = fk(A)
FilterSet
-----
class BFilterset(FilterSet)
bla bla
date = LookupChoiceFilter('a__date', lookup_choices=['exact', 'lte', 'gte'])
when I try to filter by date=, date__gte, date__lte two things happened.
date= [ this give me invalid the form calling the method from filterset is_valid() ]
date__gte and date__lte [ the is_valid() method from filterset return true but then doesn't put the date on cleaned_data from DjangoForm that generated.
Please let me known if It doesn't understand some part.
Thank to you that you are reading this. I'll keep investigating this.
This discussion was converted from issue #1290 on August 26, 2021 14:55.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Maybe this is not de best title idk if LookupChoiceFilter works in other projects but this is my second day debugging and I can't figure out what is happening.
So recently I migrate to django-filter 2.2.0 from version 1. I read that i have to change "The Filter.lookup_expr argument no longer accepts None or a list of expressions. Use the LookupChoiceFilter instead.", so i did it but now i can't filter any more.
I'm using django=2.2.16 and django-rest=3.12.1
I have two models in django
when I try to filter by date=, date__gte, date__lte two things happened.
Please let me known if It doesn't understand some part.
Thank to you that you are reading this. I'll keep investigating this.
Beta Was this translation helpful? Give feedback.
All reactions