summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2012-11-28Fixed #14694 -- Made ``defer()`` work with reverse relationsTai Lee
Reverse o2o fields are now usable with defer.
2012-11-27Removed duplicate opts.pk_index() methodAnssi Kääriäinen
2012-11-27Made sure global settings are changed in test db creationAnssi Kääriäinen
There was an assumption that changing connection.settings_dict changed also the settings.DATABASES values. This assumption is now gone.
2012-11-27Fixed #19274 -- Made db connection creation overridable in subclassesAnssi Kääriäinen
Connection creation was done in db backend ._cursor() call. This included taking a new connection if needed, initializing the session state for the new connection and finally creating the connection. To allow easier modifying of these steps in subclasses (for example to support connection pools) the _cursor() now calls get_new_connection() and init_connection_state() if there isn't an existing connection. This was done for all non-gis core backends. In addition the parameters used for taking a connection are now created by get_connection_params(). We should also do the same for gis backends and encourage 3rd party backends to use the same pattern. The pattern is not enforced in code, and as the backends are private API this will not be required by documentation either.
2012-11-27Fixed #19362 -- Detected invalid use of @python_2_unicode_compatible.Aymeric Augustin
Thanks m3wolf for the report and akaariai for reproducing the problem.
2012-11-24Updated stale docstring of setup_joinsAnssi Kääriäinen
2012-11-24Fixed #19806 -- Ensure that content types and permissions aren't created for ↵Russell Keith-Magee
swapped models. Thanks to rizumu for the report.
2012-11-24Fixed #19351 -- SQLite bulk_insert of more than 500 single-field objsAnssi Kääriäinen
2012-11-24Fixed SQLite's collapsing of same-valued instances in bulk_createAnssi Kääriäinen
SQLite used INSERT INTO tbl SELECT %s UNION SELECT %s, the problem was that there should have been UNION ALL instead of UNION. Refs #19351
2012-11-23Fixed #18375 -- Removed dict-ordering dependency for F-expressionsAnssi Kääriäinen
F() expressions reuse joins like any lookup in a .filter() call - reuse multijoins generated in the same .filter() call else generate new joins. Also, lookups can now reuse joins generated by F(). This change is backwards incompatible, but it is required to prevent dict randomization from generating different queries depending on .filter() kwarg ordering. The new way is also more consistent in how joins are reused.
2012-11-17Fixed #18989 -- Removed unused condition in CursorWrapperClaude Paroz
Thanks zimnyx for the report.
2012-11-15Fixed a regression in select_relatedAnssi Kääriäinen
The regression was caused by the fix for #13781 (commit f51e409a5fb34020e170494320a421503689aea0). Reason was leaving off some crucial lines when resolving a merge conflict.
2012-11-15Fixed #13781 -- Improved select_related in inheritance situationsAnssi Kääriäinen
The select_related code got confused when it needed to travel a reverse relation to a model which had different parent than the originally travelled relation. Thanks to Trac aliases shauncutts for report and ungenio for original patch (committed patch is somewhat modified version of that).
2012-11-15Fixed #19058 -- Fixed Oracle GIS crashAnssi Kääriäinen
The problem is the same as in #10888 which was reintroduced when bulk_insert was added. Thanks to Jani Tiainen for report, patch and also testing the final patch on Oracle GIS.
2012-11-13Fixed select_related performance regressionsAnssi Kääriäinen
The regression was caused by select_related fix for Oracle, commit c159d9cec0baab7bbd04d5d51a92a51e354a722a.
2012-11-13Removed use of SortedDict for query.alias_refcountAnssi Kääriäinen
This will have a smallish impact on performance. Refs #19276.
2012-11-08Fixed #17144 -- MySQL again groups by PK onlyAnssi Kääriäinen
Thanks to Christian Oudard for the report and tests.
2012-11-04use six.string_types for python3Mike Johnson
2012-11-04model_split: Fixed #19236 - fixed error for abstract models with a split methodMike Johnson
2012-11-04Fixed #5805 -- it is now possible to specify multi-column indexes. Thanks to ↵Alex Gaynor
jgelens for the original patch.
2012-11-03Fixed #18963 -- Used a subclass-friendly patternAymeric Augustin
for Python 2 object model compatibility methods.
2012-11-02Deprecated depth kwarg on select_related.Preston Holmes
This is the start of a deprecation path for the depth kwarg on select_related. Removing this will allow us to update select_related so it chains properly and have an API similar to prefetch_related. Thanks to Marc Tamlyn for spearheading and initial patch. refs #16855
2012-10-31Removed dupe_avoidance from sql/query and sql/compiler.pyAnssi Kääriäinen
The dupe avoidance logic was removed as it doesn't seem to do anything, it is complicated, and it has nearly zero documentation. The removal of dupe_avoidance allowed for refactoring of both the implementation and signature of Query.join(). This refactoring cascades again to some other parts. The most significant of them is the changes in qs.combine(), and compiler.select_related_descent().
2012-10-28Fixed #18575 -- Empty DATABASES should default to dummy backendClaude Paroz
Thanks delormemarco@gmail.com for the report.
2012-10-28Fixed #18823 -- Ensured m2m.clear() works when using through+to_fieldAnssi Kääriäinen
There was a potential data-loss issue involved -- when clearing instance's m2m assignments it was possible some other instance's m2m data was deleted instead. This commit also improved None handling for to_field cases.
2012-10-27Fixed Oracle failure caused by None converted to '' in select_related caseAnssi Kääriäinen
2012-10-27Fixed Oracle failure for "%" in table nameAnssi Kääriäinen
2012-10-27Fixed #19190 -- Refactored Query select clause attributesAnssi Kääriäinen
The Query.select and Query.select_fields were collapsed into one list because the attributes had to be always in sync. Now that they are in one attribute it is impossible to edit them out of sync. Similar collapse was done for Query.related_select_cols and Query.related_select_fields.
2012-10-26Merge branch 'master' into schema-alterationAndrew Godwin
Conflicts: django/db/backends/__init__.py django/db/models/fields/related.py django/db/models/options.py
2012-10-26Fixed #15040 - Boolean fields return 0 and 1 when loaded through select_relatedLuke Plant
Thanks to homm for the report and ramiro for the patch.
2012-10-25Fixed regression caused by #19102Anssi Kääriäinen
2012-10-25Fixed #19187 -- Raise consistent error from qs.values().delete()Anssi Kääriäinen
2012-10-25Added docstring to DeleteQuery.delete_qs()Anssi Kääriäinen
2012-10-25Fixed #19102 -- Fixed fast-path delete for modified SELECT clause casesAnssi Kääriäinen
There was a bug introduced in #18676 which caused fast-path deletes implemented as "DELETE WHERE pk IN <subquery>" to fail if the SELECT clause contained additional stuff (for example extra() and annotate()). Thanks to Trac alias pressureman for spotting this regression.
2012-10-24Fixed #19176 -- Typo in copy-pasted error message.Aymeric Augustin
Thanks maxirobaina for the report.
2012-10-22Fixed #19162 -- Wrong indentation.Jan Bednařík
2012-10-21Fixed #19151 -- Added missing methods to EmptyQuerySet.Jan Bednařík
Added values() and values_list() methods to EmptyQuerySet.
2012-10-10Moved F() '&' and '|' to .bitand() and .bitor()Anssi Kääriäinen
Done for consistency with Q() expressions and QuerySet combining. This will allow usage of '&' and '|' as boolean logical operators in the future. Refs #16211.
2012-10-10Revert "Fixed #16211 -- Added comparison and negation ops to F() expressions"Anssi Kääriäinen
This reverts commit 28abf5f0ebc9d380f25dd278d7ef4642c4504545. Conflicts: docs/releases/1.5.txt
2012-10-10Fixed #19096 -- Made can_return_id_from_insert more extendableMichael Manfre
RETURNING is an extension of the SQL standard, which is not implemented the same by all databases. Allow DatabaseOperations.return_insert_id to return a None to allow for other 3rd party backends with a different implementation.
2012-10-09Fix exception message from 3190abcd. Refs #18153.Aymeric Augustin
Thanks Preston Holmes.
2012-10-09Fixed #18153 -- Reverse OneToOne lookups on unsaved instances.Aymeric Augustin
Thanks David Hatch and Anssi Kääriäinen for their inputs.
2012-10-08Fixed #19087 -- Ensured query's base table is never LOUTER joinedAnssi Kääriäinen
This fixes a regression created by join promotion logic refactoring: 01b9c3d5193fe61b82ae8b26242a13fdec22f211 Thanks to Ivan Virabyan for the report.
2012-10-07Used pkgutil to get list of backend modulesClaude Paroz
Refs #18827.
2012-10-06Removed ad-hoc support for usage of short names of built-in DB backends.Ramiro Morales
This non-standard naming was deprecated in Django 1.2.
2012-10-06Ensure we ignore __pycache__ PEP 3174 dirs in a few more places.Ramiro Morales
2012-10-06Fixed #19069 -- Improved the error message when trying to query a swapped model.Russell Keith-Magee
Thanks to Preston Holmes for the suggestion.
2012-10-03Fixed #19049 -- Corrected dumb logic negation error from earlier patch.Russell Keith-Magee
2012-10-02Fixed #19049 -- Ensure that swapped models aren't included in reverse field ↵Russell Keith-Magee
caches. Thanks to Ivan Virabyan for the report.
2012-09-30Fixed #16211 -- Added comparison and negation ops to F() expressionsAnssi Kääriäinen
Work done by Walter Doekes and Trac alias knoeb. Reviewed by Simon Charette.