Skip to content

Commit

Permalink
Add len lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
danousna authored and Qu4tro committed Jun 17, 2022
1 parent e395b02 commit 67d09d2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Available lookups:
startswith: Match when string starts with given substring.
week_day: Match by week day (1-Sunday to 7-Saturday) of the timestamp.
year: Match by the year value of the timestamp.
len: Match the length of a given ArrayField

Features
--------
Expand Down
1 change: 1 addition & 0 deletions django_ufilter/backends/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class DjangoFilterBackend(BaseFilterBackend):
"iregex",
"isnull",
"istartswith",
"len",
"lt",
"lte",
"minute",
Expand Down
1 change: 1 addition & 0 deletions django_ufilter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"iendswith": forms.CharField(),
"icontains": forms.CharField(),
"contains": forms.CharField(),
"len": forms.IntegerField(min_value=0),
}

LOOKUP_CALLABLE_FROM_METHOD_REGEX = re.compile(
Expand Down

0 comments on commit 67d09d2

Please sign in to comment.