diff options
author | Anton Samarchyan <anton.samarchyan@savoirfairelinux.com> | 2017-01-24 18:04:12 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-02-28 09:17:27 -0500 |
commit | 60e52a047e55bc4cd5a93a8bd4d07baed27e9a22 (patch) | |
tree | 010a363968b1ed41adf2e64c98d572d7148a2a5e /django/db/backends/mysql/base.py | |
parent | d6e26e5b7c8063c2cc5aa045edea6555bf358fc2 (diff) | |
download | django-60e52a047e55bc4cd5a93a8bd4d07baed27e9a22.tar.gz |
Refs #27656 -- Updated django.db docstring verbs according to PEP 257.
Diffstat (limited to 'django/db/backends/mysql/base.py')
-rw-r--r-- | django/db/backends/mysql/base.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index f9908dbcb5..08632a0ec5 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -51,10 +51,10 @@ server_version_re = re.compile(r'(\d{1,2})\.(\d{1,2})\.(\d{1,2})') class CursorWrapper: """ - A thin wrapper around MySQLdb's normal cursor class so that we can catch - particular exception instances and reraise them with the right types. + A thin wrapper around MySQLdb's normal cursor class that catches particular + exception instances and reraises them with the correct types. - Implemented as a wrapper, rather than a subclass, so that we aren't stuck + Implemented as a wrapper, rather than a subclass, so that it isn't stuck to the particular underlying representation returned by Connection.cursor(). """ codes_for_integrityerror = (1048,) @@ -269,8 +269,9 @@ class DatabaseWrapper(BaseDatabaseWrapper): def disable_constraint_checking(self): """ - Disables foreign key checks, primarily for use in adding rows with forward references. Always returns True, - to indicate constraint checks need to be re-enabled. + Disable foreign key checks, primarily for use in adding rows with + forward references. Always return True to indicate constraint checks + need to be re-enabled. """ self.cursor().execute('SET foreign_key_checks=0') return True @@ -289,14 +290,14 @@ class DatabaseWrapper(BaseDatabaseWrapper): def check_constraints(self, table_names=None): """ - Checks each table name in `table_names` for rows with invalid foreign + Check each table name in `table_names` for rows with invalid foreign key references. This method is intended to be used in conjunction with `disable_constraint_checking()` and `enable_constraint_checking()`, to determine if rows with invalid references were entered while constraint checks were off. - Raises an IntegrityError on the first invalid foreign key reference - encountered (if any) and provides detailed information about the + Raise an IntegrityError on the first invalid foreign key reference + encountered (if any) and provide detailed information about the invalid reference in the error message. Backends can override this method if they can more directly apply |