Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/queries/models.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #24525 -- Fixed AssertionError in some complex ↵Tim Graham2015-09-051-0/+1
| | | | | | queries. Thanks Anssi Kääriäinen for providing the solution.
* Fixed #21127 -- Started deprecation toward requiring ↵Flavio Curella2015-07-281-64/+68
| | | | on_delete for ForeignKey/OneToOneField
* Refs #24090 -- Added a test for multi-table inheritance ↵Anssi Kääriäinen2015-07-131-1/+5
| | | | | | | | | | + subqueries. Ticket #24090 was already fixed by b68212f539f206679580afbfd008e7d329c9cd31, this commit adds tests to verify this is indeed the case. Thanks to Beauhurst for commissioning the work on this ticket.
* Fixed #24605 -- Fixed incorrect reference to alias in ↵Anssi Kääriäinen2015-04-161-0/+15
| | | | | | | subquery. Thanks to charettes and priidukull for investigating the issue, and to kurevin for the report.
* Fixed #23605 -- Fixed nested subquery regressionAnssi Kääriäinen2014-11-201-0/+15
| | | | | | | | Added relabeled_clone() method to sql.Query to fix the problem. It manifested itself in rare cases where at least double nested subquery's filter condition might target non-existing alias. Thanks to Trac alias ris for reporting the problem.
* Fixed #23721 -- check_related_objects without calling ↵Collin Anderson2014-10-281-0/+4
| | | | | | __iter__ Refs #14334
* Fixed #19671 -- Added warnings that null and validators ↵Anubhav Joshi2014-07-091-1/+1
| | | | | | are ignored for ManyToManyField. Thanks Loic Bistuer and Tim Graham for help and review.
* Fixed #14334 -- Query relation lookups now check object ↵Anubhav Joshi2014-07-011-0/+15
| | | | | | | types. Thanks rpbarlow for the suggestion; and loic, akaariai, and jorgecarleitao for reviews.
* Split tests.basic.ModelTests in several tests; refs #18586.zsoldosp2014-06-251-0/+4
|
* Fixed #22429 -- Incorrect SQL when using ~Q and FAnssi Kääriäinen2014-05-051-0/+15
|
* Fixed many typos in comments and docstrings.Rodolfo Carvalho2014-03-031-1/+1
| | | | Thanks Piotr Kasprzyk for help with the patch.
* Added tests for m2m queries with custom pk on the end modelsAnssi Kääriäinen2014-01-281-0/+6
| | | | | It seems this case was fixed somewhere between 1.5.x and 1.6.x. I added tests as I wasn't able to find any tests for these cases. Refs #21879
* Fixed #21376 -- New implementation for query join ↵Anssi Kääriäinen2013-11-071-2/+2
| | | | | | | | | | | | | | promotion logic This commit introduced a new class JoinPromoter that can be used to abstract away join promotion problems for complex filter conditions. Query._add_q() and Query.combine() now use the new class. Also, added a lot of comments about why join promotion is done the way it is. Thanks to Tim Graham for original report and testing the changes, and for Loic Bistuer for review.
* Fixing E302 ErrorsJason Myers2013-11-031-0/+91
| | | | Signed-off-by: Jason Myers <jason@jasonamyers.com>
* Fixed #14511 -- bug in .exclude() queryAnssi Kääriäinen2013-11-021-0/+19
|
* Fixed #21203 -- resolve_columns fields misalignmentAnssi Kääriäinen2013-10-011-0/+9
| | | | | In queries using .defer() together with .select_related() the values and fields arguments didn't align properly for resolve_columns().
* Fixed #15786 -- Added a regression test for o2o excludes ↵Simon Charette2013-09-291-0/+4
| | | | | | using F(). The issue was reported against 1.3.x but has been fixed since.
* Fixed #11811 -- Data-loss bug in queryset.update.Aymeric Augustin2013-09-071-0/+4
| | | | | It's now forbidden to call queryset.update(field=instance) when instance hasn't been saved to the database ie. instance.pk is None.
* Fixed "indentation is not a multiple of four" pep8 issues.Tim Graham2013-09-031-1/+1
|
* Fixed #20955 -- select_related regressionAnssi Kääriäinen2013-08-221-0/+26
| | | | | | 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.
* Fixed test failure caused by different NULL ordering ↵Anssi Kääriäinen2013-08-201-0/+4
| | | | between backends
* Refactored qs.add_q() and utils/tree.pyAnssi Kääriäinen2013-03-131-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fixed #19964 -- Removed relabel_aliases from some structsAnssi Kääriäinen2013-03-121-0/+5
| | | | | | 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.
* Fixed #15363 -- Renamed and normalized to `get_queryset` ↵Loic Bistuer2013-03-081-4/+4
| | | | the methods that return a QuerySet.
* Fixed #12823 -- Was already fixed in master, tests addedAnssi Kääriäinen2013-02-281-0/+16
| | | | | Also added a little improvement to sql/query.py to get rid of non-necessary IS NOT NULL check.
* Merged regressiontests and modeltests into the test root.Florian Apolloner2013-02-261-0/+456