summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2012-07-24Fixed #18271 -- Changed stage at which TransactionTestCase flushes DB tables.Ramiro Morales
Previously, the flush was done before the test case execution and now it is performed after it. Other changes to the testing infrastructure include: * TransactionTestCase now doesn't reset autoincrement sequences either (previous behavior can achieved by using `reset_sequences`.) With this, no implicit such reset is performed by any of the provided TestCase classes. * New ordering of test cases: All unittest tes cases are run first and doctests are run at the end. THse changes could be backward-incompatible with test cases that relied on some kind of state being preserved between tests. Please read the relevant sections of the release notes and testing documentation for further details. Thanks Andreas Pelme for the initial patch. Karen Tracey and Anssi Kääriäinen for the feedback and Anssi for reviewing. This also fixes #12408.
2012-07-23Removed a Python 3-compatibility hack.Aymeric Augustin
Thanks Preston Holmes for the patch.
2012-07-22[py3] Added Python 3 compatibility for xrange.Aymeric Augustin
2012-07-22[py3] Switched to Python 3-compatible imports.Aymeric Augustin
xrange/range will be dealt with in a separate commit due to the huge number of changes.
2012-07-22[py3] Replaced unicode/str by six.text_type/bytes.Aymeric Augustin
2012-07-22[py3] Replaced basestring by six.string_types.Aymeric Augustin
2012-07-22[py3] Removed longs.Aymeric Augustin
2012-07-22[py3] Used six.with_metaclass wherever necessary.Aymeric Augustin
2012-07-22[py3] Exception aren't iterable in Python 3.Aymeric Augustin
2012-07-22[py3] Used six.reraise wherever necessary.Aymeric Augustin
2012-07-17Switched to use a more idiomatic construct.Alex Gaynor
2012-07-17Fixed #17788 -- Added batch_size argument to qs.bulk_create()Anssi Kääriäinen
The qs.bulk_create() method did not work with large batches together with SQLite3. This commit adds a way to split the bulk into smaller batches. The default batch size is unlimited except for SQLite3 where the batch size is limited to 999 SQL parameters per batch. Thanks to everybody who participated in the discussions at Trac.
2012-07-17Fixed #17497 -- Corrected FieldError message in add_fields()Anssi Kääriäinen
The erroneous message was user visible in values_list() calls. Thanks to ojii for report and review, and to antoviaque for the patch.
2012-07-16Fixed #18056 - Cleared aggregations on DateQuery.add_date_selectNuno Maltez
Cleared aggregations on add_date_select method so only distinct dates are returned when dealing with a QuerySet that contained aggregations. That would cause the query set to return repeated dates because it would look for distinct (date kind, aggregation) pairs.
2012-07-14Switched from usign a method that was about to be deprecated to normal code.Alex Gaynor
2012-07-12Remove some code that has been dead since newforms-admin was merged, many ↵Alex Gaynor
moons ago.
2012-07-10Fixed #18602 -- Improved error message when database NAME is missingClaude Paroz
Thanks Kristian Glass for the report.
2012-07-08Fixed #18590 - Reverted Python 2.4 workaround for Model picklingClaude Paroz
Revert of 08d521efa0. Refs #10547, #12121. Thanks Michal Petrucha for the report.
2012-07-05Fixed #18330 - Made cache culling 3rd party db backend friendlyAnssi Kääriäinen
This is Ian Kelly's patch from #15580 with minor modifications.
2012-07-05Fixed #18362 - Made model.save() update_fields accept attnamesAndrei Antoukh
2012-07-03Fixed comment wording in sql/where.pyAnssi Kääriäinen
Thanks to Simon Charette for noticing this.
2012-07-01Fixed a regression introduced in where.as_sql() refactorAnssi Kääriäinen
At least Oracle needs parentheses in negated where conditions, even if there is only single condition negated. Fixed this by reverting to old logic in that part of as_sql() and adding a comment about this. I did not investigate why the parentheses are needed. The original offending commit was bd283aa844b04651b7c8b4e85f48c6dced1678f0.
2012-07-01Fixed #16047 -- Restore autocommit state correctly on psycopg2Anssi Kääriäinen
When the postgresql_psycopg2 backend was used with DB-level autocommit mode enabled, after entering transaction management and then leaving it, the isolation level was never set back to autocommit mode. Thanks brodie for report and working on this issue.
2012-07-01Fixed some locations to work with autocommit=TrueAnssi Kääriäinen
- backends: supports_transactions() - select_for_update tests
2012-07-01Refactored the empty/full result logic in WhereNode.as_sql()Anssi Kääriäinen
Made sure the WhereNode.as_sql() handles various EmptyResultSet and FullResultSet conditions correctly. Also, got rid of the FullResultSet exception class. It is now represented by '', [] return value in the as_sql() methods.
2012-07-01Fixed #18251 -- Removed a deadlock possibility in apploadingAnssi Kääriäinen
Thanks to harm for the report and comments.
2012-06-26Fixed #18465 -- Set date formats correctly on OracleJosh Smeaton
Correctly configure NLS_SESSION_PARAMETERS to format Date and DateTime on Oracle backend. Thanks to Josh Smeaton for report & patch.
2012-06-26Fixed #18515 -- Conditionally regenerated filename in FileField validationClaude Paroz
When a FileField value has been saved, a new validation should not regenerate a new filename when checking the length. Refs #9893.
2012-06-26Fixed #17485 -- Made defer work with select_relatedAnssi Kääriäinen
This commit tackles a couple of issues. First, in certain cases there were some mixups if field.attname or field.name should be deferred. Field.attname is now always used. Another issue tackled is a case where field is both deferred by .only(), and selected by select_related. This case is now an error. A lot of thanks to koniiiik (Michal Petrucha) for the patch, and to Andrei Antoukh for review.
2012-06-23Switch to using context managers for acquiring and releasing locks.Alex Gaynor
2012-06-22Fixed #17776 - DoesNotExist is not picklableLuke Plant
Thanks to ambv for the report
2012-06-19Add some field schema alteration methods and tests.Andrew Godwin
2012-06-18Very start of schema alteration port. Create/delete model and some tests.Andrew Godwin
2012-06-13Fixed connection.queries encoding handling on OracleAnssi Kääriäinen
In addition, removed a possibly problematic .filter() call from backends.test_query_encoding test. It is possible the .filter could cause collation problems on MySQL, and as it wasn't absolutely needed for the test it seemed better to get rid of the call. Refs #18461.
2012-06-13Fixed #18461 -- Ensured that last_executed_query returns UnicodeClaude Paroz
Thanks Anssi Kääriäinen for the review.
2012-06-11Fixed #18463 -- Forced type() argument to be a byte stringClaude Paroz
2012-06-09Fixed #17760 -- Implemented callable database features as cached propertiesClaude Paroz
This does remove the requirement to call features.confirm() method before checking the properties. Thanks cdestiger and Ramiro Morales for their work on the patch.
2012-06-07Fixed #18432 -- Prevented the ForeignKey field from creating an invalid ↵Jann Kleen
query when chained. Thanks, Jann Kleen.
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-06-06Small cleanup in prefetch_related codeLuke Plant
2012-06-06Fixed #18309 - Prefetch related does not work for fkey to multitable ↵Luke Plant
inherited model Thanks to milosu for the report, tests and initial patch.
2012-06-01Fixed a typo in a comment. Refs #17742.Aymeric Augustin
2012-05-31Fixed #18407 -- Made model field's to_python methods fully accept unicode.Claude Paroz
When generating error message in to_python, any unicode string containing non-ascii characters triggered a UnicodeEncodeError for most field types.
2012-05-27Fixed #18135 -- Close connection used for db version checkingMichael Newman
On MySQL when checking the server version, a new connection could be created but never closed. This could result in open connections on server startup.
2012-05-27Fixed #18343 -- Cleaned up deferred model implementationAnssi Kääriäinen
Generic cleanup and dead code removal in deferred model field loading and model.__reduce__(). Also fixed an issue where if an inherited model with a parent field chain parent_ptr_id -> id would be deferred loaded, then accessing the id field caused caused a database query, even if the id field's value is already loaded in the parent_ptr_id field.
2012-05-24Fixed qs.order_by() join promotion for already existing joinsAnssi Kääriäinen
When order_by causes new joins to be added to the query, the joins must be LEFT OUTER joins for nullable relations, otherwise the order_by could cause the results to be altered. This commit fixes the logic to only promote new joins, previously all joins in the order_by lookup path were promoted. Thanks to Bruno Desthuilliers for spotting this corner case.
2012-05-24Fixed #18177 -- Cached known related instances.Aymeric Augustin
This was recently fixed for one-to-one relations; this patch adds support for foreign keys. Thanks kaiser.yann for the report and the initial version of the patch.
2012-05-22Fixed #18319 -- Added 'supports_sequence_reset' DB featureAnssi Kääriäinen
Added a new feature to allow 3rd party backends to skip tests which test sequence resetting. Thanks to manfre for report and patch.
2012-05-22Replaced 'next' testing by collections.Iterator testing.Claude Paroz
The new construct is also Python 3 compatible (where 'next' has been renamed to '__next__').
2012-05-22Fixed #18304 -- Optimized save() when update_can_self_select=FalseAnssi Kääriäinen
Databases with update_can_self_select = False (MySQL for example) generated non-necessary queries when saving a multitable inherited model, and when the save resulted in update.