summaryrefslogtreecommitdiff
path: root/django/db/models/sql
AgeCommit message (Collapse)Author
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2014-03-07Fixed #21863 -- supplemented get_lookup() with get_transform()Anssi Kääriäinen
Also fixed #22124 -- Expanded explanation of exactly what is going on in as_sql() methods.
2014-03-03Fixed many typos in comments and docstrings.Rodolfo Carvalho
Thanks Piotr Kasprzyk for help with the patch.
2014-02-25Fixed bad grammar in a comment.Martin Matusiak
2014-02-18Fixed #22057 -- Ensured reverse_lazy can be used in settingsClaude Paroz
And without causing a circular import. Thanks Akis Kesoglou for the report.
2014-02-04Fixed #21748 -- join promotion for negated AND conditionsAnssi Kääriäinen
Made sure Django treats case .filter(NOT (a AND b)) the same way as .filter((NOT a OR NOT b)) for join promotion.
2014-02-02Removed an unused import which snuck in.Alex Gaynor
2014-02-02Ensure cursors are closed when no longer needed.Michael Manfre
This commit touchs various parts of the code base and test framework. Any found usage of opening a cursor for the sake of initializing a connection has been replaced with 'ensure_connection()'.
2014-02-02Made SQLCompiler.execute_sql(result_type) more explicit.Michael Manfre
Updated SQLUpdateCompiler.execute_sql to match the behavior described in the docstring; the 'first non-empty query' will now include all queries, not just the main and first related update. Added CURSOR and NO_RESULTS result_type constants to make the usages more self documenting and allow execute_sql to explicitly close the cursor when it is no longer needed.
2014-01-24Fixed #21787 -- regression in MTI .exclude() queriesAnssi Kääriäinen
2014-01-19Fixed Oracle query failures caused by lookup refactorAnssi Kääriäinen
Refs #21821.
2014-01-18Fixed #16187 -- refactored ORM lookup systemAnssi Kääriäinen
Allowed users to specify which lookups or transforms ("nested lookus") are available for fields. The implementation is now class based. Squashed commit of the following: commit fa7a7195f1952a9c8dea7f6e89ee13f81757eda7 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 18 10:53:24 2014 +0200 Added lookup registration API docs commit eb1c8ce164325e0d8641f14202e12486c70efdb6 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Tue Jan 14 18:59:36 2014 +0200 Release notes and other minor docs changes commit 11501c29c9352d17f22f3a0f59d3b805913dedcc Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 20:53:03 2014 +0200 Forgot to add custom_lookups tests in prev commit commit 83173b960ea7eb2b24d573f326be59948df33536 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 19:59:12 2014 +0200 Renamed Extract -> Transform commit 3b18d9f3a1bcdd93280f79654eba0efa209377bd Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 19:51:53 2014 +0200 Removed suggestion of temporary lookup registration from docs commit 21d0c7631c161fc0c67911480be5d3f13f1afa68 Merge: 2509006 f2dc442 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 09:38:23 2014 -0800 Merge pull request #2 from mjtamlyn/lookups_3 Reworked custom lookups docs. commit f2dc4429a1da04c858364972eea57a35a868dab4 Author: Marc Tamlyn <marc.tamlyn@gmail.com> Date: Sun Jan 12 13:15:05 2014 +0000 Reworked custom lookups docs. Mostly just formatting and rewording, but also replaced the example using ``YearExtract`` to use an example which is unlikely to ever be possible directly in the ORM. commit 250900650628d1f11beadb22814abd666029fb81 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Jan 12 13:19:13 2014 +0200 Removed unused import commit 4fba5dfaa022653ffa72497258ffd8f8b7476f92 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 22:34:41 2014 +0200 Added docs to index commit 6d53963f375c77a1f287833b19b976d23f36c30b Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 22:10:24 2014 +0200 Dead code removal commit f9cc0390078e21f1ea5a7bc1f15b09f8f6b0904d Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 19:00:43 2014 +0200 A new try for docs commit 33aa18a6e3c831930bda0028222a26f9c1d96e66 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 14:57:12 2014 +0200 Renamed get_cols to get_group_by_cols commit c7d5f8661b7d364962bed2e6f81161c1b4f1bcc3 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 14:45:53 2014 +0200 Altered query string customization for backends vendors The new way is trying to call first method 'as_' + connection.vendor. If that doesn't exist, then call as_sql(). Also altered how lookup registration is done. There is now RegisterLookupMixin class that is used by Field, Extract and sql.Aggregate. This allows one to register lookups for extracts and aggregates in the same way lookup registration is done for fields. commit 90e7004ec14e15503f828cc9bde2a7dab593814d Merge: 66649ff f7c2c0a Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 13:21:01 2014 +0200 Merge branch 'master' into lookups_3 commit 66649ff891c7c73c7eecf6038c9a6802611b5d8a Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Jan 11 13:16:01 2014 +0200 Some rewording in docs commit 31b8faa62714b4b6b6057a9f5cc106c4dd73caab Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 29 15:52:29 2013 +0200 Cleanup based on review comments commit 1016159f34674c0df871ed891cde72be8340bb5d Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 28 18:37:04 2013 +0200 Proof-of-concept fix for #16731 Implemented only for SQLite and PostgreSQL, and only for startswith and istartswith lookups. commit 193cd097ca8f2cc6a911e57b8e3fb726f96ee6a6 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 28 17:57:58 2013 +0200 Fixed #11722 -- iexact=F() produced invalid SQL commit 08ed3c3b49e100ed9019831e770c25c8f61b70f9 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 23:59:52 2013 +0200 Made Lookup and Extract available from django.db.models commit b99c8d83c972786c6fcd0e84c9e5cb08c1368300 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 23:06:29 2013 +0200 Fixed review notes by Loic commit 049eebc0703c151127f4f0265beceea7b8b39e72 Merge: ed8fab7 b80a835 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 22:53:10 2013 +0200 Merge branch 'master' into lookups_3 Conflicts: django/db/models/fields/__init__.py django/db/models/sql/compiler.py django/db/models/sql/query.py tests/null_queries/tests.py commit ed8fab7fe8867ff3eb801c3697a426478387bb2f Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Dec 21 22:47:23 2013 +0200 Made Extracts aware of full lookup path commit 27a57b7aed91b2f346abc4a77da838bffa17c727 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 21:10:11 2013 +0200 Removed debugger import commit 074e0f5aca0572e368c11e6d2c73c9026e7d63d7 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 21:02:16 2013 +0200 GIS lookup support added commit 760e28e72bae475b442b026650969b0d182dbe53 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 20:04:31 2013 +0200 Removed usage of Constraint, used Lookup instead commit eac47766844b90e7d3269e7a8c012eee34ec0093 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 02:22:30 2013 +0200 Minor cleanup of Lookup API commit 2adf50428d59a783078b0da3d5d035106640c899 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sun Dec 1 02:14:19 2013 +0200 Added documentation, polished implementation commit 32c04357a87e3727a34f8c5e6ec0114d1fbbb303 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Nov 30 23:10:15 2013 +0200 Avoid OrderedDict creation on lookup aggregate check commit 7c8b3a32cc17b4dbca160921d48125f1631e0df4 Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Sat Nov 30 23:04:34 2013 +0200 Implemented nested lookups But there is no support of using lookups outside filtering yet. commit 4d219d4cdef21d9c14e5d6b9299d583d1975fcba Author: Anssi Kääriäinen <akaariai@gmail.com> Date: Wed Nov 27 22:07:30 2013 +0200 Initial implementation of custom lookups
2014-01-12Fixed #21413 -- resolve_columns fields misalignmentAnssi Kääriäinen
2013-12-22Fixed #21643 -- repeated execution of qs with F() + timedeltaAlexey Voronov
Thanks Tim Graham for review.
2013-12-18Fixed #11629 -- Deprecated callable arguments to queryset methods.Baptiste Mispelon
Callable arguments were an untested and undocumented feature.
2013-12-18Fixed #21552 -- Allowed the use of None for the iexact lookup.Denis Moskalets
Thanks Anubhav Joshi for the documentation.
2013-12-14Fixed E127 pep8 warnings.Loic Bistuer
2013-12-06Fixed #21554 -- Incorrect SQL generated when using multiple inheritance.pegler
2013-11-30Fixed comment typos.Alex Hill
2013-11-28Fixed E125 pep8 warningsChristopher Medrela
2013-11-27Used simpler queries for m2m clearing when possible.Anssi Kääriäinen
Refs #21169
2013-11-15Fixed typo and slightly improved error message when db is missing time zone ↵Loic Bistuer
definitions. Refs #21432.
2013-11-14Fixed #21432 -- DateTimeQuery now copies tzinfo when cloning.Loic Bistuer
Thanks Enrique Martínez for the report and @bmispelon for the tests.
2013-11-07Fixed #20600 -- ordered distinct(*fields) in subqueriesAnssi Kääriäinen
2013-11-07Removed non-necessary code in Compiler._setup_joins()Anssi Kääriäinen
2013-11-07Removed Query.setup_joins() and join() argument outer_if_first.Anssi Kääriäinen
Instead always create new joins as OUTER.
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-03Fixed regressions from 36ded01527b690b5df0574492af9cfcc2ea3d1dc.Florian Apolloner
Refs #21302
2013-11-02Fixed all E261 warningscoagulant
2013-11-02Fixed #14511 -- bug in .exclude() queryAnssi Kääriäinen
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-11-02Fixed #21366 -- regression in join promotion logicAnssi Kääriäinen
The regression was caused by ecaba3602837d1e02fe1e961f7d3bf9086453259 and affected OR connected filters.
2013-10-21Fixed #21249 -- variable name typo in compiler.get_grouping()Anssi Kääriäinen
The typo could have consequences in exceptional cases, but I didn't figure out a way to actually produce such a case, so not tests. Report & patch by Michael Manfre.
2013-10-21Fixed #21288 -- Fixed E126 pep8 warningsAlasdair Nicol
2013-10-15Fixed #16855 -- select_related() chains as expected.Marc Tamlyn
select_related('foo').select_related('bar') is now equivalent to select_related('foo', 'bar'). Also reworded docs to recommend select_related(*fields) over select_related()
2013-10-05Fixed #18414 -- qs.exists() for sliced distinct queriesAnssi Kääriäinen
2013-10-05Improved Query join promotion logicAnssi Kääriäinen
There were multiple cases where join promotion was a bit too aggressive. This resulted in using outer joins where not necessary. Refs #21150.
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-25Fixed #21126 -- QuerySet value conversion failureAnssi Kääriäinen
A .annotate().select_related() query resulted in misaligned rows vs columns for compiler.resolve_columns() method. Report & patch by Michael Manfre.
2013-09-24Added '*' to quote_cacheAnssi Kääriäinen
The commit for #18333 missed quote_cache default value for *. Refs #18333.
2013-09-24Fixed #18333 - Quoted annotated column namesMichael Manfre
2013-09-24Fix small grammatical error in comment.Andrei Picus
Changed 'there are no filtering' to 'there is no filtering'.
2013-09-22Removed a few trailing backslashes.Aymeric Augustin
We have always been at war with trailing backslashes.
2013-09-16Fixed #17627 -- Renamed util.py files to utils.pyTim Graham
Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor Kołodziej for the initial patch.
2013-09-14Fixed #20950 -- Instantiate OrderedDict() only when neededAnssi Kääriäinen
The use of OrderedDict (even an empty one) was surprisingly slow. By initializing OrderedDict only when needed it is possible to save non-trivial amount of computing time (Model.save() is around 30% faster for example). This commit targetted sql.Query only, there are likely other places which could use similar optimizations.
2013-09-06Minor factorization.Aymeric Augustin
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-08-30Removed stale add_q() commentAnssi Kääriäinen
2013-08-29Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()Tim Graham
Thanks jeroen.pulles at redslider.net for the suggestion and helper script.
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.