summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
AgeCommit message (Collapse)Author
2015-10-27[1.9.x] Fixed #25609 -- Fixed regression in related field nested lookup error.Ian Foote
Backport of 32ef48aa562e6aaee9983f5d0f1c60f02fd555fb from master
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
2015-01-30Fixed #24211 -- Removed ValuesQuerySet() and ValuesListQuerySet().Loic Bistuer
Thanks Anssi Kääriäinen, Marc Tamlyn, and Tim Graham for the reviews.
2015-01-27Fixed #24154 -- Backends can now check support for expressionsJosh Smeaton
2015-01-20Fixed a query failure on Python 3.5; refs #23763.Tim Graham
The failure was introduced in Django by c7fd9b242d2d63406f1de6cc3204e35aaa025233 and the change in Python 3.5 is https://hg.python.org/cpython/rev/a3c345ba3563.
2015-01-19Removed legacy ORM lookup support per deprecation timeline; refs #16187.Tim Graham
2015-01-18Removed support for callable QuerySet arguments per deprecation timeline; ↵Tim Graham
refs #11629.
2015-01-12Fixed #24031 -- Added CASE expressions to the ORM.Michał Modzelewski
2015-01-13Fixed #24060 -- Added OrderBy ExpressionsJosh Smeaton
2015-01-08Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
2015-01-06Fixed #12663 -- Formalized the Model._meta API for retrieving fields.Daniel Pyrathon
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
2015-01-02Fixed #9104 -- Moved FieldDoesNotExist to core.exceptionsDaniel Pyrathon
2014-12-31Fixed #23758 -- Allowed more than 5 levels of subqueriesPiotr Pawlaczek
Refactored bump_prefix() to avoid infinite loop and allow more than than 5 subquires by extending the alphabet to use multi-letters.
2014-12-23Fixed #21414 -- Removed RelatedObject and deprecated Field.related.Anssi Kääriäinen
2014-12-08Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne
comprehension
2014-11-28Fixed #23853 -- Added Join class to replace JoinInfoAnssi Kääriäinen
Also removed Query.join_map. This structure was used to speed up join reuse calculation. Initial benchmarking shows that this isn't actually needed. If there are use cases where the removal has real-world performance implications, it should be relatively straightforward to reintroduce it as map {alias: [Join-like objects]}.
2014-11-27Fixed #23877 -- aggregation's subquery missed target colAnssi Kääriäinen
Aggregation over subquery produced syntactically incorrect queries in some cases as Django didn't ensure that source expressions of the aggregation were present in the subquery.
2014-11-27Fixed #23875 -- cleaned up query.get_count()Anssi Kääriäinen
2014-11-26Fixed #23867 -- removed DateQuerySet hacksAnssi Kääriäinen
The .dates() queries were implemented by using custom Query, QuerySet, and Compiler classes. Instead implement them by using expressions and database converters APIs.
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-11-17Moved bilateral transform fetching to models.lookupsAnssi Kääriäinen
2014-11-15Fixed #14030 -- Allowed annotations to accept all expressionsJosh Smeaton
2014-11-12Removed extra enumerate() from Query.setup_joins()Anssi Kääriäinen
2014-11-12Improved Query.names_to_path docstringAnssi Kääriäinen
2014-11-11Simplified Query.build_lookup()Anssi Kääriäinen