#31426: Add proper field validation to QuerySet.order_by.
-------------------------------------+-------------------------------------
Reporter: Maxim | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: ORDER_PATTERN, | Triage Stage: Accepted
order_by |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* status: closed => new
* type: Bug => Cleanup/optimization
* resolution: needsinfo =>
Comment:
I'm not aware of any tested support for invalid Python identifiers as
annotation name but I guess we could accept this ticket on the basis that
`order_by` does weird things and should perform proper field validation
instead of a naive regexp checks.
To summarize while tweaking the regex would address your immediate issue I
think it's worth calling `Query.names_to_path` on `str` input to validate
they are valid I'll submit a PR for that.
--
Ticket URL: <https://code.djangoproject.com/ticket/31426#comment:4>
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/065.d0afa9c0a3c7f96bfe3ac62fa2ecf824%40djangoproject.com.