summaryrefslogtreecommitdiff
path: root/django/db/utils.py
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-02-09Silence deprecation warnings.Marc Tamlyn
Also they should only be raised if allow_syncdb does exist, not just if allow_migrate does not. Refs comments on 250841017c6c456806cadd214b4e130aa998233d
2014-02-09Raise (pending) deprecation warning for allow_syncdb.Marc Tamlyn
2014-02-08Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag
import_string(). Thanks Aymeric Augustin for the suggestion and review.
2013-12-29Changed get_migratable_models to use an app config.Aymeric Augustin
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Removed module-level functions for the app cache.Aymeric Augustin
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.
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-10-18Fixed #21287 -- Fixed E123 pep8 warningsAlasdair Nicol
2013-10-16Add get_migratable_models util method to ConnectionRouterClaude Paroz
2013-09-17Fixed #21109 -- made db cursor error wrapping fasterAnssi Kääriäinen
2013-08-09Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
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
2013-07-30Rename allow_syncdb to allow_migrateAndrew Godwin
2013-07-29Deprecated django.utils.importlibClaude Paroz
This was a shim for pre-Python 2.7 support.
2013-07-01Removed some conditional code only needed under Python 2.6.Aymeric Augustin
2013-06-29Advanced deprecation warnings for Django 1.7.Aymeric Augustin
2013-06-04Fixed #17601 -- expose underlying db exceptions under py2James Aylett
Use __cause__ to expose the underlying database exceptions even under python 2.
2013-05-24Fixed a regression in router initializationClaude Paroz
Regression was introduced in 6a6bb168b. Thanks Bas Peschier for the report.
2013-05-23Delayed settings.DATABASE_ROUTERS usage by ConnectionRouterClaude Paroz
Refs #20474.
2013-05-23Delayed settings.DATABASES usage by ConnectionHandlerClaude Paroz
Refs #20474.
2013-05-09Fixed #20215 -- Disabled persistent connections by default.Aymeric Augustin
2013-03-11Deprecated TransactionMiddleware and TRANSACTIONS_MANAGED.Aymeric Augustin
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.
2013-02-28Fixed tests broken in 2ee21d9.Aymeric Augustin
2013-02-28Implemented persistent database connections.Aymeric Augustin
Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
2013-02-27Fixed two bugs in 59a35208.Aymeric Augustin
* StandardError doesn't exist any more under Python 3. * Python 2.6 still allows `raise "foo"`.
2013-02-27Refactored database exceptions wrapping.Aymeric Augustin
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.
2013-02-13Removed try-except in django.db.close_connection()Anssi Kääriäinen
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.
2013-02-10Fixed #19707 -- Reset transaction state after requestsAnssi Kääriäinen
2013-02-04Fixed #17061 -- Factored out importing object from a dotted pathClaude Paroz
Thanks Carl Meyer for the report.
2012-12-08Fixed #19357 -- Allow non-ASCII chars in filesystem pathsClaude Paroz
Thanks kujiu for the report and Aymeric Augustin for the review.
2012-10-28Fixed #18575 -- Empty DATABASES should default to dummy backendClaude Paroz
Thanks delormemarco@gmail.com 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-07-22[py3] Replaced basestring by six.string_types.Aymeric Augustin
2012-04-29Fixed #18013 -- Use the new 'as' syntax for exceptions.Claude Paroz
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
2011-12-25Fixed #17047 -- Improved django.db.utils.load_backend to raise a better ↵Jannis Leidel
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
2011-12-16Fixed #17258 -- Moved `threading.local` from `DatabaseWrapper` to the ↵Julien Phalip
`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
2011-11-18Added support for time zones. Thanks Luke Plant for the review. Fixed #2626.Aymeric Augustin
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
2011-03-30Removed legacy handing for `settings.DATABAS_*` and using short-form ↵Alex Gaynor
references to the included database backends. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15959 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-17Fixed #15621 -- Fixed potentially confusing error message in db backend ↵Adrian Holovaty
loading. Thanks, keegan_csmith git-svn-id: http://code.djangoproject.com/svn/django/trunk@15871 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-16Changed django/db/utils.py load_backend() to call sorted() instead of ↵Adrian Holovaty
.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
2010-12-08Fixed the world's ugliest syntax (that's not an actual error) that snuck in ↵Alex Gaynor
with [14857]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14859 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-08Fixed #14870 -- don't catch AttributeErrors in database router methods, ↵Alex Gaynor
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
2010-10-11Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings to ↵Russell Keith-Magee
DeprecationWarnings, and removed 1.1 deprecated code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-08Fixed #14381 -- Clarified exception handling when instantiating Routers. ↵Russell Keith-Magee
Thanks to dauerbaustelle for the suggestion and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-29Fixed #12702 -- Introduced a common implementation of DatabaseError and ↵Russell Keith-Magee
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
2010-01-28Fixed #12718 -- Tighten up the error handling when loading database routers. ↵Russell Keith-Magee
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