summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
AgeCommit message (Collapse)Author
2017-01-31[1.11.x] Fixed #27800 -- Fixed QuerySet.annotate(Length(...)).distinct() crash.Lex Berezhny
Backport of ac5f886c5610a6bca26dab10170b445d1e9df450 from master
2017-01-16Fixed #25307 -- Fixed QuerySet.annotate() crash with conditional expressions.Josh Smeaton
Thanks Travis Newport for the tests and Josh Smeaton for contributing to the patch.
2017-01-14Fixed #27718 -- Added QuerySet.union(), intersection(), difference().Florian Apolloner
Thanks Mariusz Felisiak for review and Oracle assistance. Thanks Tim Graham for review and writing docs.
2016-12-07Fixed #17002 -- Allowed using a ManyToManyField through model that inherits ↵InvalidInterrupt
another.
2016-12-01Fixed #27546 -- Removed hardcoded class names in __repr__() methods.Keda87
2016-10-28Fixed #20939 -- Simplified query generation by converting QuerySet to Query.Tim Graham
Thanks Anssi Kääriäinen for the initial patch and Anssi, Simon Charette, and Josh Smeaton for review.
2016-10-24Removed unused loop in Query.change_aliases().Tim Graham
Unknown if it was ever used.
2016-10-14Tested QuerySet compatibility check.Tim Graham
cdfdcf4b70bebfc68871df885387790c6afbc23c missed this test.
2016-10-13Removed unneeded try/except in Query.names_to_path().Tim Graham
2016-10-13Removed unused branch in Query.change_aliases().Tim Graham
Unused since 0c7633178fa9410f102e4708cef979b873bccb76.
2016-09-27Fixed #27268 -- Restored an invalid related field lookup error message in ↵Mariusz Felisiak
QuerySet filtering.
2016-09-17Made FieldError/FieldDoesNotExist messages uniform across Python versions.François Freitag
Removed possible u'' prefixes on Python 2.
2016-08-19Fixed #22288 -- Fixed F() expressions with the __range lookup.Matthew Wilkes
2016-08-16Fixed #24854 -- Refactored QuerySet._valuesIan Foote
Added django.db.models.sql.query.Query.set_values() method to handle query mutation.
2016-08-08Fixed #26500 -- Added SKIP LOCKED support to select_for_update().Simon Charette
Thanks Tim for the review.
2016-05-19Fixed #26515 -- Fixed Query.trim_joins() for nested ForeignObjects.darius BERNARD
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-04-04Fixed W503 flake8 warnings.Tim Graham
2016-03-28Sorted single letter imports per the latest version of isort.Tim Graham
2016-02-27Fixed #26230 -- Made default_related_name affect related_query_name.chenesan
2016-02-11Fixed #26196 -- Made sure __in lookups use to_field as default.Anssi Kääriäinen
Thanks Simon Charette for the test.
2015-12-17Refs #25894 -- Fixed evaluation of zero-length slices of QuerySet.values() ↵Sergey Fedoseev
on Oracle.
2015-10-27Fixed #25609 -- Fixed regression in related field nested lookup error.Ian Foote
2015-09-23Refs #14030 -- Removed backwards compatiblity for old-style aggregates.Tim Graham
Per deprecation timeline.
2015-09-21Fixed #24629 -- Unified Transform and Expression APIsJosh Smeaton
2015-09-17Removed the unused JoinPromoter.outer_votes attribute.Simon Charette
2015-09-05Fixed #24525 -- Fixed AssertionError in some complex queries.Tim Graham
Thanks Anssi Kääriäinen for providing the solution.
2015-08-15Fixed #24986 -- Added support for annotations in DISTINCT queries.Valentina Mukhamedzhanova
2015-08-14Made Options.get_base_chain() always return a list.Valentina Mukhamedzhanova
2015-07-27Fixed #25095 -- Fixed annotate() + values() group by bugMitchell Kotler
Thanks Josh Smeaton for help on the tests.
2015-07-13Fixed #24923 -- errored out nicely when using aggregates in order_by()Anssi Kääriäinen
2015-06-29Fixed #23791 -- Corrected object type check for pk__in=qsAnssi Kääriäinen
When the pk was a relation field, qs.filter(pk__in=qs) didn't work. In addition, fixed Restaurant.objects.filter(place=restaurant_instance), where place is an OneToOneField and the primary key of Restaurant. A big thank you to Josh for review and to Tim for review and cosmetic edits. Thanks to Beauhurst for commissioning the work on this ticket.
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-06-05Refs #24833 -- Forwardported some of "Fixed Case expressions with exclude()."Andriy Sokolovskiy
Partial forwardport of 469f1e362bb9670b174b37da9edd4631aff7badb from stable/1.8.x as the issue was already fixed in master.
2015-05-25Fixed #24835 -- Fixed QuerySet.exists() after an annotation with Count()Paweł Marczewski
QuerySet.exists() incorrectly handled query.group_by = True case (grouping by all select fields), causing GROUP BY expressions to be wiped along with select fields.
2015-05-20Fixed #24705 -- Fixed negated Q objects in expressions.Anssi Kääriäinen
Avoided split_exclude() for Q when used as an expression.
2015-05-17Renamed value_to_db_xxx to adapt_xxxfield_value.Aymeric Augustin
This mirrors convert_xxxfield_value nicely, taking advantage of the adapter/converter terminology which is commonly used by DB-API modules.
2015-05-17Removed global timezone-aware datetime adapters.Aymeric Augustin
Refs #23820. Fixed #19738. Refs #17755. In order not to introduce a regression for raw queries, parameters are passed through the connection.ops.value_to_db_* methods, depending on their type.
2015-04-28Fixed #24719 -- Restored the ability to use interators as queryset related ↵Aric Coady
object filters.
2015-04-14Fixed #24277 -- Added exception when dict used in QuerySet filteringAlex Wilson
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
2015-03-25Removed field.field check in setup_joins()Anssi Kääriäinen
2015-03-25Refs #24267 -- Implemented lookups for related fieldsAnssi Kääriäinen
Previously related fields didn't implement get_lookup, instead related fields were treated specially. This commit removed some of the special handling. In particular, related fields return Lookup instances now, too. Other notable changes in this commit is removal of support for annotations in names_to_path().
2015-03-09Fixed #24171 -- Fixed failure with complex aggregate query and expressionsAnssi Kääriäinen
The query used a construct of qs.annotate().values().aggregate() where the first annotate used an F-object reference and the values() and aggregate() calls referenced that F-object. Also made sure the inner query's select clause is as simple as possible, and made sure .values().distinct().aggreate() works correctly.
2015-02-20Fixed #24343 -- Ensure db converters are used for foreign keys.Marc Tamlyn
Joint effort between myself, Josh, Anssi and Shai.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-04Removed EverythingNodeAnssi Kääriäinen
At the same time, made sure that empty nodes in where clause match everything.
2015-02-04Fixed #24268 -- removed Query.havingAnssi Kääriäinen
Instead of splitting filter clauses to where and having parts before adding them to query.where or query.having, add all filter clauses to query.where, and when compiling the query split the where to having and where parts.
2015-02-01Removed query.alias_diff()Tim Graham
This function is unused since 6fe2b001dba45134d7c10729c57959995e241a88
2015-02-01Removed Query.raise_field_error()Tim Graham
This method was inadvertently reintroduced in f59fd15c4928caf3dfcbd50f6ab47be409a43b01