summaryrefslogtreecommitdiff
path: root/tests/ordering
AgeCommit message (Collapse)Author
2023-02-27[4.2.x] Fixed #34372 -- Fixed queryset crash on order by aggregation using ↵Simon Charette
OrderBy. 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. Backport of b15f162f252610e3b510ade465549769ab4356cf from main
2023-02-20[4.2.x] Fixed #34346 -- Ordered selected expressions by position.Simon Charette
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. Backport of 278881e37619278789942513916acafaa88d26f3 from main
2023-02-18[4.2.x] Refs #33308 -- Added tests for queryset ordered by annotation with ↵Simon Charette
nulls_first/nulls_last. Backport of a6511bc23329f1d3939571ad01d3176f8f6cb786 from main
2022-10-18Fixed #34105 -- Fixed crash of ordering by nested selected expression.Simon Charette
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.
2022-10-08Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner
assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-10-04Fixed #34012 -- Made QuerySet.order_by() apply transforms on related fields ↵David Sanders
for models with Meta.ordering. 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.
2022-05-12Fixed #29538 -- Fixed crash of ordering by related fields when Meta.ordering ↵Ed Rivas
contains expressions. Thanks Simon Charette for the review.
2022-02-22Removed redundant QuerySet.all() calls in docs and tests.Nick Pope
Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-03-16Fixed #32546 -- Avoided Meta.ordering columns in GROUP BY clauses.Yuri Konotopov
Follow up to 0ddb4ebf7bfcc4730c80a772dd146a49ef6895f6.
2020-11-03Removed serial pk assumption in ordering tests.Tim Graham
Fixed OrderingTests.test_order_by_fk_attname and test_order_by_pk on CockroachDB.
2020-07-15Fixed #30446 -- Resolved Value.output_field for stdlib types.Simon Charette
This required implementing a limited form of dynamic dispatch to combine expressions with numerical output. Refs #26355 should eventually provide a better interface for that.
2020-06-10Fixed #31657 -- Fixed ordering by attnames of self-referential ForeignKeys.Hasan Ramezani
2020-06-10Refs #31657 -- Added test for ordering by self-referential ForeignKeys.Hasan Ramezani
2020-04-30Removed unused __str__() methods in tests models.Mariusz Felisiak
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2019-09-10Refs #14357 -- Made Meta.ordering not affect GROUP BY queries.Mariusz Felisiak
Per deprecation timeline.
2019-07-11Refs #30557 -- Fixed crash of ordering by ptr fields when Meta.ordering ↵Mariusz Felisiak
contains F() expressions. Thanks Can Sarıgöl for the report. Follow up to 8c5f9906c56ac72fc4f13218dd90bdf9bc8a248b.
2019-07-11Fixed #30557 -- Fixed crash of ordering by ptr fields when Meta.ordering ↵Hasan Ramezani
contains expressions.
2019-05-31Fixed #26192 -- Fixed crash of ordering by constants on PostgreSQL.Mariusz Felisiak
Thanks Simon Charette for the review.
2019-05-31Refs #26192 -- Added tests for ordering by constant value.Mariusz Felisiak
2019-05-23Fixed #30501 -- Preventing QuerySet.reverse() from mutating expressions in ↵Mariusz Felisiak
QuerySet.order_by and Meta.ordering.
2019-05-18Fixed #30463 -- Fixed crash of deprecation message when Meta.ordering ↵ruchit2801
contains expressions. Regression in 1b1f64ee5a78cc217fead52cbae23114502cf564.
2018-09-13Refs #14357 -- Deprecated Meta.ordering affecting GROUP BY queries.Ramiro Morales
Thanks Ramiro Morales for contributing to the patch.
2017-11-27Fixed #28848 -- Fixed SQLite/MySQL crash when ordering by a filtered ↵Raphael Michel
subquery that uses nulls_first/nulls_last.
2017-10-21Fixed #28722 -- Made QuerySet.reverse() affect nulls_first/nulls_last.Tomer Chachamu
2017-09-05Fixed #28335 -- Allowed query expressions in Meta.ordering.Dima Kudosh
2017-05-31Fixed #22550 -- Prohibited QuerySet.last()/reverse() after slicing.Matthias Erll
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-12-08Fixed #13312 -- Allowed specifying the order of null fields in queries.Yohann Gabory
Thanks Mariusz Felisiak for finishing the patch.
2016-11-15Used setUpTestData() in ordering tests.Mariusz Felisiak
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-09-13Fixed #27203 -- Replaced assertQuerysetEqual(..., lambda o: o) with ↵Mads Jensen
assertSequenceEqual().
2016-09-09Refs #25415 -- Fixed invalid models in the test suite.Adam Chainz
2016-03-09Correct a grammatical error: "it's related model"Noenglish Professorbut
I am no English professor, but "inheriting its related model" should not contain an apostrophe. For reference, see http://theoatmeal.com/comics/apostrophe
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-04-20Fixed #24654 -- Based ordering circular references detection on columns.Simon Charette
Thanks to Elmar Bucher for the report and Tim for the review.
2015-01-28Refs #24060 -- Added a test demonstrating reverse order isn't mutableJosh Smeaton
2015-01-19Fixed #24174 -- Fixed extra order by descendingJosh Smeaton
2015-01-13Fixed #24060 -- Added OrderBy ExpressionsJosh Smeaton
2014-09-24Removed numbering from the models.py header of some test packages.Loic Bistuer
This is a reliqua from the early days of the modeltests/regressiontests era.
2014-04-30Fixed #19195 -- Allow explicit ordering by a relation `_id` field.Simon Charette
Thanks to chrisedgemon for the report and shaib, akaariai and timgraham for the review.
2013-11-02Fixing E302 ErrorsJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-10-23Fixed #21298 -- Fixed E301 pep8 warningsAlasdair Nicol
2013-10-19Removed unused local variables in tests.Tim Graham
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner