summaryrefslogtreecommitdiff
path: root/tests/queries/models.py
AgeCommit message (Collapse)Author
2018-11-21Fixed #29974 -- Fixed non-truthy primary key values for QuerySet.bulk_update().Tom Forbes
2018-09-18Fixed #23646 -- Added QuerySet.bulk_update() to efficiently update many models.Tom Forbes
2018-03-20Fixed #29227 -- Allowed BooleanField to be null=True.Tim Graham
Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
2018-01-20Refs #20487 -- Added test for querying mixed case fields with common related ↵Mariusz Felisiak
model. Thanks Shai Berger for the review.
2017-12-28Removed unnecessary trailing commas and spaces in various code.Mariusz Felisiak
2017-04-23Fixed #28101 -- Fixed a regression with nested __in subquery lookups and ↵Simon Charette
to_field. Thanks Kristian Klette for the report and Tim for the help.
2017-03-06Fixed #26522 -- Fixed a nondeterministic AssertionError in QuerySet combining.Bo Marchman
Thanks Andrew Brown for the test case.
2017-02-09Fixed #26551 -- Fixed negated Q() queries that span relations.François Freitag
Prevented queries from reusing trimmed joins.
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-09-09Refs #25415 -- Fixed invalid models in the test suite.Adam Chainz
2016-08-17Refs #26983 -- Added test for isnull lookup to CharField with primary_key=True.Chris Lamb
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-09-05Fixed #24525 -- Fixed AssertionError in some complex queries.Tim Graham
Thanks Anssi Kääriäinen for providing the solution.
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-07-13Refs #24090 -- Added a test for multi-table inheritance + subqueries.Anssi Kääriäinen
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.
2015-04-16Fixed #24605 -- Fixed incorrect reference to alias in subquery.Anssi Kääriäinen
Thanks to charettes and priidukull for investigating the issue, and to kurevin for the report.
2014-11-20Fixed #23605 -- Fixed nested subquery regressionAnssi Kääriäinen
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.
2014-10-28Fixed #23721 -- check_related_objects without calling __iter__Collin Anderson
Refs #14334
2014-07-09Fixed #19671 -- Added warnings that null and validators are ignored for ↵Anubhav Joshi
ManyToManyField. Thanks Loic Bistuer and Tim Graham for help and review.
2014-07-01Fixed #14334 -- Query relation lookups now check object types.Anubhav Joshi
Thanks rpbarlow for the suggestion; and loic, akaariai, and jorgecarleitao for reviews.
2014-06-25Split tests.basic.ModelTests in several tests; refs #18586.zsoldosp
2014-05-05Fixed #22429 -- Incorrect SQL when using ~Q and FAnssi Kääriäinen
2014-03-03Fixed many typos in comments and docstrings.Rodolfo Carvalho
Thanks Piotr Kasprzyk for help with the patch.
2014-01-28Added tests for m2m queries with custom pk on the end modelsAnssi Kääriäinen
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
2013-11-07Fixed #21376 -- New implementation for query join promotion logicAnssi Kääriäinen
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.
2013-11-02Fixing E302 ErrorsJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-11-02Fixed #14511 -- bug in .exclude() queryAnssi Kääriäinen
2013-10-01Fixed #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().
2013-09-29Fixed #15786 -- Added a regression test for o2o excludes using F().Simon Charette
The issue was reported against 1.3.x but has been fixed since.
2013-09-06Fixed #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.
2013-09-03Fixed "indentation is not a multiple of four" pep8 issues.Tim Graham
2013-08-22Fixed #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.
2013-08-20Fixed test failure caused by different NULL ordering between backendsAnssi Kääriäinen
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