#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
-------------------------------------+-------------------------------------

Comment (by Václav Řehák):

 Thank you for the quick answer. However, the proposed solution does not
 work as changing the uuid lookup to exact causes an error when searching
 for any string other than valid uuid value.

 I get ValidationError raised from UUIDField.to_python()


 {{{
 File "/home/vaclav/.local/share/virtualenvs/aaa-yRfablWV/lib/python3.7
 /site-packages/django/db/models/fields/__init__.py" in to_python
   2325.                 return uuid.UUID(value)

 File "/usr/lib/python3.7/uuid.py" in __init__
   160.                 raise ValueError('badly formed hexadecimal UUID
 string')
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29915#comment:2>
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.bedaf5b2a2183e847f132ad7f0ae26c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to