summaryrefslogtreecommitdiff
path: root/django/db/utils.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Raise (pending) deprecation warning for allow_syncdb.Marc Tamlyn2014-02-091-0/+4
|
* Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag2014-02-081-2/+2
| | | | | | import_string(). Thanks Aymeric Augustin for the suggestion and review.
* Changed get_migratable_models to use an app config.Aymeric Augustin2013-12-291-4/+3
|
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-2/+2
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Moved the new app cache inside core.Aymeric Augustin2013-12-171-1/+1
|
* Removed module-level functions for the app cache.Aymeric Augustin2013-12-171-2/+2
| | | | | | | | | | | | | | | Since the original ones in django.db.models.loading were kept only for backwards compatibility, there's no need to recreate them. However, many internals of Django still relied on them. They were also imported in django.db.models. They never appear in the documentation, except a quick mention of get_models and get_app in the 1.2 release notes to document an edge case in GIS. I don't think that makes them a public API. This commit doesn't change the overall amount of global state but clarifies that it's tied to the app_cache object instead of hiding it behind half a dozen functions.
* Fixed #21302 -- Fixed unused imports and import *.Tim Graham2013-11-021-1/+0
|
* Fixed #21287 -- Fixed E123 pep8 warningsAlasdair Nicol2013-10-181-1/+1
|
* Add get_migratable_models util method to ConnectionRouterClaude Paroz2013-10-161-0/+8
|
* Fixed #21109 -- made db cursor error wrapping fasterAnssi Kääriäinen2013-09-171-1/+2
|
* Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2013-08-091-2/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: django/core/management/commands/flush.py django/core/management/commands/syncdb.py django/db/models/loading.py docs/internals/deprecation.txt docs/ref/django-admin.txt docs/releases/1.7.txt
| * Deprecated django.utils.importlibClaude Paroz2013-07-291-2/+2
| | | | | | | | This was a shim for pre-Python 2.7 support.
* | Rename allow_syncdb to allow_migrateAndrew Godwin2013-07-301-2/+5
|/
* Removed some conditional code only needed under Python 2.6.Aymeric Augustin2013-07-011-6/+1
|
* Advanced deprecation warnings for Django 1.7.Aymeric Augustin2013-06-291-1/+1
|
* Fixed #17601 -- expose underlying db exceptions under py2James Aylett2013-06-041-2/+1
| | | | | Use __cause__ to expose the underlying database exceptions even under python 2.
* Fixed a regression in router initializationClaude Paroz2013-05-241-2/+3
| | | | | Regression was introduced in 6a6bb168b. Thanks Bas Peschier for the report.
* Delayed settings.DATABASE_ROUTERS usage by ConnectionRouterClaude Paroz2013-05-231-4/+13
| | | | Refs #20474.
* Delayed settings.DATABASES usage by ConnectionHandlerClaude Paroz2013-05-231-6/+18
| | | | Refs #20474.
* Fixed #20215 -- Disabled persistent connections by default.Aymeric Augustin2013-05-091-1/+1
|
* Deprecated TransactionMiddleware and TRANSACTIONS_MANAGED.Aymeric Augustin2013-03-111-0/+8
| | | | | | | Replaced them with per-database options, for proper multi-db support. Also toned down the recommendation to tie transactions to HTTP requests. Thanks Jeremy for sharing his experience.
* Fixed tests broken in 2ee21d9.Aymeric Augustin2013-02-281-0/+3
|
* Implemented persistent database connections.Aymeric Augustin2013-02-281-4/+11
| | | | Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
* Fixed two bugs in 59a35208.Aymeric Augustin2013-02-271-2/+7
| | | | | * StandardError doesn't exist any more under Python 3. * Python 2.6 still allows `raise "foo"`.
* Refactored database exceptions wrapping.Aymeric Augustin2013-02-271-4/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 2181d833ed1a2e422494738dcef311164c4e097e Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Wed Feb 27 14:28:39 2013 +0100 Fixed #15901 -- Wrapped all PEP-249 exceptions. commit 5476a5d93c19aa2f928c497d39ce6e33f52694e2 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Tue Feb 26 17:26:52 2013 +0100 Added PEP 3134 exception chaining. Thanks Jacob Kaplan-Moss for the suggestion. commit 9365fad0a650328002fb424457d675a273c95802 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Tue Feb 26 17:13:49 2013 +0100 Improved API for wrapping database errors. Thanks Alex Gaynor for the proposal. commit 1b463b765f2826f73a8d9266795cd5da4f8d5e9e Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Tue Feb 26 15:00:39 2013 +0100 Removed redundant exception wrapping. This is now taken care of by the cursor wrapper. commit 524bc7345a724bf526bdd2dd1bcf5ede67d6bb5c Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Tue Feb 26 14:55:10 2013 +0100 Wrapped database exceptions in the base backend. This covers the most common PEP-249 APIs: - Connection APIs: close(), commit(), rollback(), cursor() - Cursor APIs: callproc(), close(), execute(), executemany(), fetchone(), fetchmany(), fetchall(), nextset(). Fixed #19920. commit a66746bb5f0839f35543222787fce3b6a0d0a3ea Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Tue Feb 26 14:53:34 2013 +0100 Added a wrap_database_exception context manager and decorator. It re-throws backend-specific exceptions using Django's common wrappers.
* Removed try-except in django.db.close_connection()Anssi Kääriäinen2013-02-131-3/+0
| | | | | | | | | | The reason was that the except clause needed to remove a connection from the django.db.connections dict, but other parts of Django do not expect this to happen. In addition the except clause was silently swallowing the exception messages. Refs #19707, special thanks to Carl Meyer for pointing out that this approach should be taken.
* Fixed #19707 -- Reset transaction state after requestsAnssi Kääriäinen2013-02-101-0/+3
|
* Fixed #17061 -- Factored out importing object from a dotted pathClaude Paroz2013-02-041-11/+2
| | | | Thanks Carl Meyer for the report.
* Fixed #19357 -- Allow non-ASCII chars in filesystem pathsClaude Paroz2012-12-081-1/+2
| | | | Thanks kujiu for the report and Aymeric Augustin for the review.
* Fixed #18575 -- Empty DATABASES should default to dummy backendClaude Paroz2012-10-281-1/+8
| | | | Thanks delormemarco@gmail.com for the report.
* Used pkgutil to get list of backend modulesClaude Paroz2012-10-071-3/+4
| | | | Refs #18827.
* Removed ad-hoc support for usage of short names of built-in DB backends.Ramiro Morales2012-10-061-16/+7
| | | | This non-standard naming was deprecated in Django 1.2.
* Ensure we ignore __pycache__ PEP 3174 dirs in a few more places.Ramiro Morales2012-10-061-1/+1
|
* [py3] Replaced basestring by six.string_types.Aymeric Augustin2012-07-221-1/+2
|
* Fixed #18013 -- Use the new 'as' syntax for exceptions.Claude Paroz2012-04-291-2/+2
| | | | | Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
* Fixed #17047 -- Improved django.db.utils.load_backend to raise a better ↵Jannis Leidel2011-12-251-6/+16
| | | | | | exception when using a unqualified database backend name. Thanks, Jonas Obrist. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17274 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #17258 -- Moved `threading.local` from `DatabaseWrapper` to the ↵Julien Phalip2011-12-161-4/+8
| | | | | | `django.db.connections` dictionary. This allows connections to be explicitly shared between multiple threads and is particularly useful for enabling the sharing of in-memory SQLite connections. Many thanks to Anssi Kääriäinen for the excellent suggestions and feedback, and to Alex Gaynor for the reviews. Refs #2879. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17205 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added support for time zones. Thanks Luke Plant for the review. Fixed #2626.Aymeric Augustin2011-11-181-1/+1
| | | | | | | | | For more information on this project, see this thread: http://groups.google.com/group/django-developers/browse_thread/thread/cf0423bbb85b1bbf git-svn-id: http://code.djangoproject.com/svn/django/trunk@17106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed legacy handing for `settings.DATABAS_*` and using short-form ↵Alex Gaynor2011-03-301-36/+24
| | | | | | references to the included database backends. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15959 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15621 -- Fixed potentially confusing error message in db backend ↵Adrian Holovaty2011-03-171-0/+2
| | | | | | loading. Thanks, keegan_csmith git-svn-id: http://code.djangoproject.com/svn/django/trunk@15871 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed django/db/utils.py load_backend() to call sorted() instead of ↵Adrian Holovaty2011-03-161-2/+1
| | | | | | .sort(). Saves us a line of code. Taken from patch for #15621 git-svn-id: http://code.djangoproject.com/svn/django/trunk@15851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed the world's ugliest syntax (that's not an actual error) that snuck in ↵Alex Gaynor2010-12-081-2/+1
| | | | | | with [14857]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14859 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14870 -- don't catch AttributeErrors in database router methods, ↵Alex Gaynor2010-12-081-9/+17
| | | | | | instead check that the method itself exists. Thanks to jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14857 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings to ↵Russell Keith-Magee2010-10-111-1/+1
| | | | | | DeprecationWarnings, and removed 1.1 deprecated code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14381 -- Clarified exception handling when instantiating Routers. ↵Russell Keith-Magee2010-10-081-1/+3
| | | | | | Thanks to dauerbaustelle for the suggestion and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12702 -- Introduced a common implementation of DatabaseError and ↵Russell Keith-Magee2010-01-291-0/+13
| | | | | | IntegrityError, so that database backends can (re)raise common error classes. Thanks for Waldemar Kornewald for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12352 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12718 -- Tighten up the error handling when loading database routers. ↵Russell Keith-Magee2010-01-281-2/+3
| | | | | | Thanks to Jeff Balogh for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12336 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12693 -- Improved error handling when there is an error setting up ↵Russell Keith-Magee2010-01-271-3/+8
| | | | | | the database router chain. Thanks to dhageman for the report and fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Made the database master router tolerant of router definitions that omit ↵Russell Keith-Magee2010-01-271-9/+21
| | | | | | individual routing methods. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12304 bcc190cf-cafb-0310-a4f2-bffc1f526a37