#29915: Allow icontains lookup to accept uuids with or without dashes
-------------------------------------+-------------------------------------
Reporter: Václav Řehák | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: uuid admin | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* type: Bug => Cleanup/optimization
* component: contrib.admin => Database layer (models, ORM)
* stage: Unreviewed => Accepted
Comment:
This isn't really an admin issue but rather it's due to the fact that the
default admin lookup uses `__icontains`. You could fix the issue by using
`search_fields = ['uuidfield__exact']` (adding `__exact`) although that
doesn't allow searching for part of the UUID value.
I'll tentatively accept the ticket to allow
`QuerySet.objects.filter(uuidfield__icontains='...')` to work with values
with or without dashes
--
Ticket URL: <https://code.djangoproject.com/ticket/29915#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.32ae7fc0db8275d62bedf4a67393d8ee%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.