summaryrefslogtreecommitdiff
path: root/django/db/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Added backward compatibility test for ConnectionHandler.databases property.Nick Pope2022-05-131-0/+3
| | | | | | The ConnectionHandler.databases property is no longer used within Django, but it is maintained for backward compatibility with 3rd party packages that have used this private API in the past.
* Made closing in connection handlers more DRY.Nick Pope2022-05-121-8/+0
|
* Moved ensure_defaults() and prepare_test_settings() logic to ↵Florian Apolloner2022-03-171-44/+25
| | | | ConnectionHandler.configure_settings().
* Removed usage of django.db.utils.ConnectionHandler.databases.Florian Apolloner2022-03-171-3/+3
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-41/+46
|
* Fixed #30398 -- Added CONN_HEALTH_CHECKS database setting.Przemysław Suliga2021-12-011-0/+1
| | | | | | | The CONN_HEALTH_CHECKS setting can be used to enable database connection health checks for Django's persistent DB connections. Thanks Florian Apolloner for reviews.
* Refs #25175 -- Removed postgresql_psycopg2 in django.db.utils.load_backend().Mariusz Felisiak2021-01-061-1/+1
| | | Follow up to 944469939b9eb93fda0924f78faba5c0ffae2dff.
* Simplified django.db.utils.load_backend().William Schwartz2021-01-041-3/+2
| | | | | | Previously load_backend() performed search by computing the (sole) entry of django.db.backends.__path__ manually from django.db.utils.__file__. Now django.db.backends.__path__ is used directly.
* Fixed #32233 -- Cleaned-up duplicate connection functionality.Florian Apolloner2020-12-081-54/+29
|
* Fixed #32197 -- Improved error message when loading a database backend fails.Hasan Ramezani2020-11-161-2/+4
|
* Fixed #25388 -- Added an option to allow disabling of migrations during test ↵Jon Dufresne2019-11-201-2/+9
| | | | database creation.
* Fixed #30451 -- Added ASGI handler and coroutine-safety.Andrew Godwin2019-06-201-2/+8
| | | | | This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.
* Fixed #30071 -- Fixed error message when a 'default' database isn't provided.Benjy Weinberger2019-01-091-3/+2
|
* Ref #23919 -- Replaced some os.path usage with pathlib.Path.Tom2018-04-191-2/+2
|
* Refs #23919 -- Used "raise from" instead of __cause__ in reraising ↵Mariusz Felisiak2017-04-251-2/+1
| | | | | backend-specific database exceptions. Thanks Tim Graham for the review.
* Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan2017-02-281-7/+5
|
* Tidied djang.db.utils.load_backend().Tim Graham2017-01-241-15/+11
| | | | Removed an unneeded EnvironmentError catching and used "raise from exc" syntax.
* Refs #23919 -- Removed __traceback__ setting needed for Python 2.Tim Graham2017-01-241-2/+0
| | | Partially reverted refs #25761 and refs #16245.
* Refs #23919 -- Replaced six.reraise by raiseClaude Paroz2017-01-221-2/+1
|
* Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham2017-01-201-3/+2
| | | These functions do nothing on Python 3.
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-3/+3
|
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-181-1/+1
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz2017-01-181-1/+1
| | | | Thanks Tim Graham for the review.
* Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions.Raphaël Hertzog2015-12-031-0/+2
| | | | | | | | | | | | | | | | | When Django reraises an exception, it sets the __cause__ attribute even in Python 2, mimicking Python's 3 behavior for "raise Foo from Bar". However, Python 3 also ensures that all exceptions have a __traceback__ attribute and thus the "traceback2" Python 2 module (backport of Python 3's "traceback" module) relies on the fact that whenever you have a __cause__ attribute, the recorded exception also has a __traceback__ attribute. This is breaking testtools which is using traceback2 (see https://github.com/testing-cabal/testtools/issues/162). This commit fixes this inconsistency by ensuring that Django sets the __traceback__ attribute on any exception stored in a __cause__ attribute of a reraised exception.
* Refs #24351 -- Removed support for the old allow_migrate() signature per ↵Tim Graham2015-09-231-23/+1
| | | | deprecation timeline.
* Fixed #25175 -- Renamed the postgresql_psycopg2 database backend to postgresql.Caio Ariede2015-08-071-2/+10
|
* Fixed db.utils.load_backend() on non-ASCII paths.Tim Graham2015-07-171-2/+2
|
* Filtered out 'base' from database backend choices error message.Tim Graham2015-07-151-1/+1
|
* Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham2015-06-241-3/+3
| | | | | Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
* Fixed #24979 -- Removed usage of inspect.getargspec().Tim Graham2015-06-151-2/+10
|
* Fixed flake8 warnings on Python 3.Tim Graham2015-06-151-1/+1
|
* Fixed #23820 -- Supported per-database time zone.Aymeric Augustin2015-05-171-1/+1
| | | | | | | | | The primary use case is to interact with a third-party database (not primarily managed by Django) that doesn't support time zones and where datetimes are stored in local time when USE_TZ is True. Configuring a PostgreSQL database with the TIME_ZONE option while USE_TZ is False used to result in silent data corruption. Now this is an error.
* Fixed #24394 -- Allowed running tests with empty default dictionary.Andrei Kulakov2015-03-251-0/+3
|
* Fixed #24351, #24346 -- Changed the signature of allow_migrate().Loic Bistuer2015-02-201-6/+29
| | | | | | | | | | | | | | The new signature enables better support for routing RunPython and RunSQL operations, especially w.r.t. reusable and third-party apps. This commit also takes advantage of the deprecation cycle for the old signature to remove the backward incompatibility introduced in #22583; RunPython and RunSQL won't call allow_migrate() when when the router has the old signature. Thanks Aymeric Augustin and Tim Graham for helping shape up the patch. Refs 22583.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-4/+3
|
* Removed support for old-style test database settings per deprecation timeline.Tim Graham2015-01-171-39/+0
|
* Removed fallback suport for allow_syncdb() in database routers per ↵Tim Graham2015-01-171-8/+1
| | | | deprecation timeline.
* Fixed #22583 -- Allowed RunPython and RunSQL to provide hints to the db router.Loic Bistuer2015-01-101-2/+2
| | | | Thanks Markus Holtermann and Tim Graham for the review.
* Fixed #21255 -- Closed connections after management command ranClaude Paroz2014-12-291-0/+8
| | | | | Thanks kabakov.as@gmail.com for the report, and Aymeric Augustin, Simon Charette for the reviews.
* Restored the 'TEST_' prefix in the warning about deprecated test database ↵Shai Berger2014-12-011-1/+1
| | | | settings
* Fixed #21755 -- Added ForeignKey support to REQUIRED_FIELDS.Anubhav Joshi2014-07-031-4/+4
| | | | | | | This allows specifying ForeignKeys in REQUIRED_FIELDS when using a custom User model. Thanks cjerdonek and bmispelon for suggestion and timgraham for review.
* Silenced deprecation warnings for refs #22811 and fixed build.Tim Graham2014-06-121-1/+1
|
* Fixed #22811 -- Allowed setting both the old and new TEST database settings.Tim Graham2014-06-121-7/+19
| | | | An ImproperlyConfigured exception will be raised they mismatch.
* Fixed #21430 -- Added a RuntimeWarning when unpickling Models and QuerySets ↵Anubhav Joshi2014-06-111-0/+1
| | | | | | | from a different Django version. Thanks FunkyBob for the suggestion, prasoon2211 for the initial patch, and akaariai, loic, and charettes for helping in shaping the patch.
* Removed deprecated TRANSACTIONS_MANAGED setting.Aymeric Augustin2014-03-211-6/+1
|
* Fixed the last fix for database test settings to work with Python3.Shai Berger2014-03-091-1/+1
|
* Fixed test breakage following test-settings enhancementsShai Berger2014-03-091-0/+3
|
* Reorganized the database test settingsShai Berger2014-03-091-2/+36
| | | | | | | | | | Change database test settings from "TEST_"-prefixed entries in the database settings dictionary to setting in a dictionary that is itself an entry "TEST" in the database settings. Refs #21775 Thanks Josh Smeaton for review.
* Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz2014-03-081-2/+3
| | | | | Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
* Silence deprecation warnings.Marc Tamlyn2014-02-091-2/+2
| | | | | | | Also they should only be raised if allow_syncdb does exist, not just if allow_migrate does not. Refs comments on 250841017c6c456806cadd214b4e130aa998233d