#31426: Can't use uuid for order_by
-------------------------------------+-------------------------------------
Reporter: Maxim | Owner: nobody
Type: New | Status: new
feature |
Component: Database | Version: 2.2
layer (models, ORM) | Keywords: ORDER_PATTERN,
Severity: Normal | order_by
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
When you annotate a QuerySet with a uuid key, the order_by functionality
breaks for the uuid column because the uuid is "not a valid order_by
argument".
\\
Changing the constant django.db.models.sql.constants.ORDER_PATTERN by
allowing a "-"
\\
from
{{{
ORDER_PATTERN = re.compile(r'\?|[-+]?[.\w]+$')
}}}
to
{{{
ORDER_PATTERN = re.compile(r'\?|[-+]?[.\-\w]+$')
}}}
fixes this in PostgreSQL.
\\
\\
Is there a reason the former pattern was used, is it incompatible with
other dbs?
--
Ticket URL: <https://code.djangoproject.com/ticket/31426>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.95c4f7e713db03281648f5d4f8b794e8%40djangoproject.com.