-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UUID filter with lookup startswith #110
Comments
I'm willing to open a PRI just need to know with which approach this should be resolved with. Should it be added try/except on the form cleanup? Should be created some engineering to allow 'partial values` with specific lookups (startswith, istartswith, endswith, iendswith, icontains, contains)? Should this be treated only for UUID Fields? |
@miki725 friendly ping |
I think the maintener has died, just look at the pull requests session... |
Sad life 😢 |
Resume
My application uses UUIDField as a primary key. So every model inherit
I want to filter by this id!
ID filter
It's possible do filter by ID.
So we can do a request like
And it works 🎉 !
ID startswith filter
statswith
is a supported lookup on url-filters!django-url-filter/url_filter/backends/django.py
Lines 22 to 48 in 1585da8
So it should be possible do a request like
It doens't work 👎
The problem
The filter calls the django form
clean
!django-url-filter/url_filter/filters.py
Lines 335 to 353 in 1585da8
REMEMBER, I'm passing a incomplete UUID because the goal is to search with the first part of the UUID with the lookup
startswith
!This causes the
django.forms.fields.UUIDField.clean
method to raise a ValidationError!The text was updated successfully, but these errors were encountered: