summaryrefslogtreecommitdiff
path: root/django/db/models/sql
AgeCommit message (Collapse)Author
2015-09-05[1.8.x] Fixed #24525 -- Fixed AssertionError in some complex queries.Tim Graham
Thanks Anssi Kääriäinen for providing the solution. Backport of 2dc9ec5616a942de3a0886a707f93988f56dd594 from master
2015-08-20[1.8.x] Fixed #24951 -- Fixed AssertionError in delete queries involving a ↵Tim Graham
foreign/primary key. Thanks Anssi Kääriäinen for help. Backport of 333cbdcd2de4546e33ad50ebd8b67e1a1e87aeec from master
2015-06-23[1.8.x] Renamed RemovedInDjango20Warning to RemovedInDjango110Warning.Tim Graham
2015-06-05[1.8.x] Fixed #24833 -- Fixed Case expressions with exclude().Andriy Sokolovskiy
2015-05-25[1.8.x] Fixed #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. Backport of 801a84ae329a24d9adf01b700429fe8f1285b2b8 from master
2015-05-20[1.8.x] Fixed #24705 -- Fixed negated Q objects in expressions.Anssi Kääriäinen
Avoided split_exclude() for Q when used as an expression. Backport of bc87061a3c7c8d6b4d2469f35cc78683c6cff647 from master
2015-05-11[1.8.x] Fixed #24748 -- Fixed incorrect GROUP BY on MySQL in some queriesAnssi Kääriäinen
When the query's model had a self-referential foreign key, the compiler.get_group_by() code incorrectly used the self-referential foreign key's column (for example parent_id) as GROUP BY clause when it should have used the model's primary key column (id). Backport of adc57632bc26cc8fe42bdb6aff463f883214980a from master
2015-04-28[1.8.x] Fixed #24719 -- Restored the ability to use interators as queryset ↵Aric Coady
related object filters. Backport of 9c2d8cde77ee6edd407e92f93eacd4624290394f from master
2015-04-16[1.8.x] Fixed #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. Backport of 355c5edd9390caad5725375abca03460805f663b from master
2015-04-16[1.8.x] Fixed #24615 -- ordering by expression not part of SELECTAnssi Kääriäinen
Fixed queries where an expression was used in order_by() but the expression wasn't in the query's select clause (for example the expression could be masked by .values() call) Thanks to Trac alias MattBlack85 for the report. Backport of fb5c7748da from master.
2015-04-13[1.8.x] Fixed #24611 -- Fixed update() crash with related UUID pk object.Jay Wineinger
Backport of 923da0274a9a8c4ef2ac9776f71bd14628e39fc3 from master
2015-03-09[1.8.x] Fixed #24171 -- Fixed failure with complex aggregate query and ↵Anssi Kääriäinen
expressions 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. Backport of fb146193c49e4c683dc8da39d9b7c479375fdb57 from master
2015-02-20[1.8.x] Update converters to take a consistent set of parameters.Marc Tamlyn
As suggested by Anssi. This has the slightly strange side effect of passing the expression to Expression.convert_value has the expression passed back to it, but it allows more complex patterns of expressions. Backport of 32d4db66b9 from master
2015-02-20[1.8.x] Fixed #24343 -- Ensure db converters are used for foreign keys.Marc Tamlyn
Joint effort between myself, Josh, Anssi and Shai. Conflicts: django/db/models/query.py tests/model_fields/models.py Backport of 4755f8fc25331c739a6f932cc8aba0cc9e62e352 from master.
2015-02-09[1.8.x] Sorted imports with isort; refs #23860.Tim Graham
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
2015-02-01[1.8.x] Removed query.alias_diff()Tim Graham
This function is unused since 6fe2b001dba45134d7c10729c57959995e241a88 Backport of f79ce63fdb6788c8b4857fece6c86de57fc129ee from master
2015-02-01[1.8.x] Removed Query.raise_field_error()Tim Graham
This method was inadvertently reintroduced in f59fd15c4928caf3dfcbd50f6ab47be409a43b01 Backport of 99ca7c2bd3e04b343f4a0fe2d5add7c6d6f3a456 from master
2015-01-30[1.8.x] Fixed #14483 -- Allowed using subqueries with GIS lookupsClaude Paroz
Backport of a0b5f15ea5f from master.
2015-01-30[1.8.x] Fixed #24164 -- Fixed Oracle GIS limited aggregation test failure.Tim Graham
Backport of 29c0073335c7f7cdc482866e093e5e42a42625e5 from master
2015-01-27[1.8.x] Fixed #24154 -- Backends can now check support for expressionsJosh Smeaton
Backport of 8196e4bdf498acb05e6680c81f9d7bf700f4295c from master
2015-01-20[1.8.x] Fixed 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. Backport of be1357e70983d4ad029a1ecdd05292f8be917a80 from master
2015-01-19[1.8.x] Fixed #24174 -- Fixed extra order by descendingJosh Smeaton
Backport of 69c6a6868f0b4137bb293ff4326ecf4681506c37 from master
2015-01-15Replaced inner functions by class methods.Simon Charette
refs #24031 Thanks to Tim Graham and Michał Modzelewski for the review.
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-24Fixed #10414 -- Made select_related() fail on invalid field names.Niclas Olofsson
2014-12-23Fixed #21414 -- Removed RelatedObject and deprecated Field.related.Anssi Kääriäinen
2014-12-18Refs #24020 -- return expressions from get_group_by_cols()Anssi Kääriäinen
2014-12-13Fixed #23812 -- Changed django.utils.six.moves.xrange imports to rangeMichael Hall
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-20Fixed #23876 -- Removed dead code in SQLAggregateCompiler.Carl Meyer
2014-11-18Deprecated calling a SQLCompiler instance.Carl Meyer
2014-11-17Moved bilateral transform fetching to models.lookupsAnssi Kääriäinen
2014-11-16Renamed qn to compilerJosh Smeaton
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
2014-10-28Fixed #23721 -- check_related_objects without calling __iter__Collin Anderson
Refs #14334
2014-10-28Fixed #23493 -- Added bilateral attribute to TransformThomas Chaumeny
2014-10-21Fixed #23396 -- Ensured ValueQuerySets are not checked by check_related_objects.Gabe Jackson