summaryrefslogtreecommitdiff
path: root/tests/queries
AgeCommit message (Collapse)Author
2013-10-01[1.6.x] Fixed #21203 -- resolve_columns fields misalignmentAnssi Kääriäinen
In queries using .defer() together with .select_related() the values and fields arguments didn't align properly for resolve_columns(). Backpatch of bf13c75c0d94d606b8a077ff73bbd0440f05b396 from master.
2013-09-29[1.6.x] Fixed #21167 - Improved queries.tests.SubqueryTestsMichael Manfre
Improve tests to cover slicing scenarios that could be handled in unique ways by 3rd party database backends. Backport of b0e06c3662 from master
2013-09-06[1.6.x] Fixed #11811 -- Data-loss bug in queryset.update.Aymeric Augustin
It's now forbidden to call queryset.update(field=instance) when instance hasn't been saved to the database ie. instance.pk is None. Conflicts: tests/queries/tests.py Backport of b4cd8169 from master.
2013-08-22[1.6.x] Fixed #20955 -- select_related regressionAnssi Kääriäinen
In cases where the same connection (from model A to model B along the same field) was needed multiple times in a select_related query, the join setup code mistakenly reused an existing join. Backpatch of 8d65b6082c8bf5df25608d8733470879a8a61d7d. Conflicts: django/db/models/sql/compiler.py tests/queries/tests.py
2013-07-26[1.6.x] Fixed related model lookup regressionAnssi Kääriäinen
It has been possible to use models of wrong type in related field lookups. For example pigs__in=[a_duck] has worked. Changes to ForeignObject broke that. It might be a good idea to restrict the model types usable in lookups. This should be done intentionally, not accidentally and without any consideration for deprecation path. Backpatch of 7cca8d56d28e321ffc395c92f82d97adaa0dcf94 from master.
2013-06-18Fixed #14930 -- values_list() failure on qs ordered by extra columnFlorian Hahn
Thanks lsaffre for the report and simon29, vicould, and Florian Hahn for the patch. Some changes done by committer.
2013-06-14Fixed #20528 -- regression in select_related join promotionAnssi Kääriäinen
The join used by select_related was incorrectly INNER when the query had an ORed filter for nullable join that was trimmed away. Fixed this by forcing the join type to LOUTER even when a join was trimmed away in ORed queries.
2013-06-01Changed assertEquals -> assertEqual.Tim Graham
2013-06-01Fixed #18785 -- Added Test join trimming regressionAnssi Kääriäinen
The regression was caused by patch to ticket #15316 and was fixed by a patch to #10790.
2013-05-29Fixed #20250 - Added a regression test for negated Q + annotateTim Graham
Thanks nott.
2013-05-27Fixed #20507 -- SubqueryConstraint alias relabelingAnssi Kääriäinen
The SubqueryConstraint defined relabeled_clone(), but that was never called. Instead there is now clone() and relabel_aliases() methods for SubqueryConstraint. A related problem was that SubqueryConstraint didn't correctly use quote_name_unless_alias() of the outer query. This resulted in failures when running under PostgreSQL.
2013-05-22Fixed #19895 -- Second iterator over invalid qs raises errorsAnssi Kääriäinen
The fix was already in the patch for #18702, so only test added for ticket #19895.
2013-05-21Fixed #18702 -- Removed chunked reads from QuerySet iterationAnssi Kääriäinen
2013-05-20Fixed qs.values() regression when used in subqueryAnssi Kääriäinen
2013-03-26Fixed #20091 -- Oracle null promotion for empty stringsAnssi Kääriäinen
2013-03-21Added tests for already fixed #20101Anssi Kääriäinen
The ticket dealt with a case where one query had .exclude() that produced a subquery, the other query had a join to the same model that was subqueried in the first query. This was already fixed in master, so only test added.
2013-03-13Refactored qs.add_q() and utils/tree.pyAnssi Kääriäinen
The sql/query.py add_q method did a lot of where/having tree hacking to get complex queries to work correctly. The logic was refactored so that it should be simpler to understand. The new logic should also produce leaner WHERE conditions. The changes cascade somewhat, as some other parts of Django (like add_filter() and WhereNode) expect boolean trees in certain format or they fail to work. So to fix the add_q() one must fix utils/tree.py, some things in add_filter(), WhereNode and so on. This commit also fixed add_filter to see negate clauses up the path. A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to .filter(~Q(reversefk__in=a_list)). The reason for this is that only the immediate parent negate clauses were seen by add_filter, and thus a tree like AND: (NOT AND: (AND: condition)) will not be handled correctly, as there is one intermediary AND node in the tree. The example tree is generated by .exclude(~Q(reversefk__in=a_list)). Still, aggregation lost connectors in OR cases, and F() objects and aggregates in same filter clause caused GROUP BY problems on some databases. Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
2013-03-12Fixed #19964 -- Removed relabel_aliases from some structsAnssi Kääriäinen
Before there was need to have both .relabel_aliases() and .clone() for many structs. Now there is only relabeled_clone() for those structs where alias is the only mutable attribute.
2013-03-08Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that ↵Loic Bistuer
return a QuerySet.
2013-02-28Fixed #12823 -- Was already fixed in master, tests addedAnssi Kääriäinen
Also added a little improvement to sql/query.py to get rid of non-necessary IS NOT NULL check.
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner