<feed xmlns='http://www.w3.org/2005/Atom'>
<title>django.git/tests/ordering/tests.py, branch main</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/django.git/atom?h=main</id>
<link rel='self' href='http://cgit.adnoto.dev/django.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/'/>
<updated>2026-02-13T21:58:36Z</updated>
<entry>
<title>Fixed #36857 -- Added QuerySet.totally_ordered property.</title>
<updated>2026-02-13T21:58:36Z</updated>
<author>
<name>VIZZARD-X</name>
<email>vigneshanandmay13@gmail.com</email>
</author>
<published>2026-01-09T20:56:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=08b4dfc5734f5d2fce685eabcd65385a6656db2f'/>
<id>urn:sha1:08b4dfc5734f5d2fce685eabcd65385a6656db2f</id>
<content type='text'>
Thanks Simon Charette for the idea.
</content>
</entry>
<entry>
<title>Refs CVE-2026-1312 -- Raised ValueError when FilteredRelation aliases contain periods.</title>
<updated>2026-02-03T12:56:04Z</updated>
<author>
<name>Jacob Walls</name>
<email>jacobtylerwalls@gmail.com</email>
</author>
<published>2026-01-21T23:00:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=005d60d97c4dfb117503bdb6f2facfcaf9315d84'/>
<id>urn:sha1:005d60d97c4dfb117503bdb6f2facfcaf9315d84</id>
<content type='text'>
This prevents failures at the database layer, given that aliases in the
ON clause are not quoted.

Systematically quoting aliases even in FilteredRelation is tracked in
https://code.djangoproject.com/ticket/36795.
</content>
</entry>
<entry>
<title>Fixed CVE-2026-1312 -- Protected order_by() from SQL injection via aliases with periods.</title>
<updated>2026-02-03T12:55:33Z</updated>
<author>
<name>Jacob Walls</name>
<email>jacobtylerwalls@gmail.com</email>
</author>
<published>2026-01-21T22:53:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=69065ca869b0970dff8fdd8fafb390bf8b3bf222'/>
<id>urn:sha1:69065ca869b0970dff8fdd8fafb390bf8b3bf222</id>
<content type='text'>
Before, `order_by()` treated a period in a field name as a sign that it
was requested via `.extra(order_by=...)` and thus should be passed
through as raw table and column names, even if `extra()` was not used.
Since periods are permitted in aliases, this meant user-controlled
aliases could force the `order_by()` clause to resolve to a raw table
and column pair instead of the actual target field for the alias.

In practice, only `FilteredRelation` was affected, as the other
expressions we tested, e.g. `F`, aggressively optimize away the ordering
expressions into ordinal positions, e.g. ORDER BY 2, instead of ORDER BY
"table".column.

Thanks Solomon Kebede for the report, and Simon Charette and Jake Howard
for reviews.
</content>
</entry>
<entry>
<title>Fixed #36407 -- Ensured default value is cast in Case expressions used in ORDER BY clause.</title>
<updated>2025-06-05T07:52:56Z</updated>
<author>
<name>ontowhee</name>
<email>82607723+ontowhee@users.noreply.github.com</email>
</author>
<published>2025-05-22T18:06:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=68c9f7e0b79168007e6ba0139fd315d7c44ca8c9'/>
<id>urn:sha1:68c9f7e0b79168007e6ba0139fd315d7c44ca8c9</id>
<content type='text'>
Thanks to deceze for the report. Thanks to Sarah Boyce for the test.
Thanks to Simon Charette for the investigation and review.
</content>
</entry>
<entry>
<title>Fixed #34372 -- Fixed queryset crash on order by aggregation using OrderBy.</title>
<updated>2023-02-27T06:10:19Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2023-02-27T06:10:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=b15f162f252610e3b510ade465549769ab4356cf'/>
<id>urn:sha1:b15f162f252610e3b510ade465549769ab4356cf</id>
<content type='text'>
Regression in 278881e37619278789942513916acafaa88d26f3 caused by a lack
of expression copying when an OrderBy expression is explicitly provided.

Thanks Jannis Vajen for the report and regression test.</content>
</entry>
<entry>
<title>Fixed #34346 -- Ordered selected expressions by position.</title>
<updated>2023-02-20T04:54:25Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2023-02-18T01:38:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=278881e37619278789942513916acafaa88d26f3'/>
<id>urn:sha1:278881e37619278789942513916acafaa88d26f3</id>
<content type='text'>
Used the same approach as for #34176 by using selected expressions
position to prevent ambiguous aliases in collisions.

Thanks henribru for the report.

Regression in 04518e310d4552ff7595a34f5a7f93487d78a406.
</content>
</entry>
<entry>
<title>Refs #33308 -- Added tests for queryset ordered by annotation with nulls_first/nulls_last.</title>
<updated>2023-02-18T15:28:10Z</updated>
<author>
<name>Simon Charette</name>
<email>charettes@users.noreply.github.com</email>
</author>
<published>2023-02-18T13:53:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=a6511bc23329f1d3939571ad01d3176f8f6cb786'/>
<id>urn:sha1:a6511bc23329f1d3939571ad01d3176f8f6cb786</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed #34105 -- Fixed crash of ordering by nested selected expression.</title>
<updated>2022-10-19T00:31:45Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2022-10-19T00:31:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=d62563cbb194c420f242bfced52b37d6638e67c6'/>
<id>urn:sha1:d62563cbb194c420f242bfced52b37d6638e67c6</id>
<content type='text'>
This stops ordering by nested selected references. It's not supported on
PostgreSQL and not required to support psycopg3.

Regression in 04518e310d4552ff7595a34f5a7f93487d78a406.

Thanks Matt Westcott for the report.</content>
</entry>
<entry>
<title>Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to assertQuerySetEqual().</title>
<updated>2022-10-08T06:07:38Z</updated>
<author>
<name>Gregor Gärtner</name>
<email>code@gregorgaertner.de</email>
</author>
<published>2022-09-24T10:29:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=f0c06f8ab7904e1fd082f2de57337f6c7e05f177'/>
<id>urn:sha1:f0c06f8ab7904e1fd082f2de57337f6c7e05f177</id>
<content type='text'>
Co-Authored-By: Michael Howitz &lt;mh@gocept.com&gt;
</content>
</entry>
<entry>
<title>Fixed #34012 -- Made QuerySet.order_by() apply transforms on related fields for models with Meta.ordering.</title>
<updated>2022-10-04T06:19:34Z</updated>
<author>
<name>David Sanders</name>
<email>shang.xiao.sanders@gmail.com</email>
</author>
<published>2022-09-17T15:44:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=4771a1694b3b54c7309602820881d3ec9cc2c809'/>
<id>urn:sha1:4771a1694b3b54c7309602820881d3ec9cc2c809</id>
<content type='text'>
This makes QuerySet.order_by() no longer ignore trailing transforms for
models with Meta.ordering. As a consequence, FieldError is raised in
such cases for non-existent fields.

Thanks to Klaas van Schelven for the report and Mariusz Felisiak for the
review and advice.
</content>
</entry>
</feed>
