diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-02 12:12:51 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-02 13:33:17 +0100 |
| commit | d63e55039d42c2ba8bb6c8f8d133ede085b60969 (patch) | |
| tree | e2f7a982a0ac89495258e1516edc3e057274570b /django/db/backends/sqlite3 | |
| parent | c5a25c2771f0362a5775f81f9f4eb6b3c9caed62 (diff) | |
Reordered methods in database wrappers.
* Grouped related methods together -- with banner comments :/
* Described which methods are intended to be implemented in backends.
* Added docstrings.
* Used the same order in all wrappers.
Diffstat (limited to 'django/db/backends/sqlite3')
| -rw-r--r-- | django/db/backends/sqlite3/base.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index ad54af46ad..416a6293f5 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -347,8 +347,13 @@ class DatabaseWrapper(BaseDatabaseWrapper): def create_cursor(self): return self.connection.cursor(factory=SQLiteCursorWrapper) - def is_usable(self): - return True + def close(self): + self.validate_thread_sharing() + # If database is in memory, closing the connection destroys the + # database. To prevent accidental data loss, ignore close requests on + # an in-memory db. + if self.settings_dict['NAME'] != ":memory:": + BaseDatabaseWrapper.close(self) def check_constraints(self, table_names=None): """ @@ -384,13 +389,9 @@ class DatabaseWrapper(BaseDatabaseWrapper): % (table_name, bad_row[0], table_name, column_name, bad_row[1], referenced_table_name, referenced_column_name)) - def close(self): - self.validate_thread_sharing() - # If database is in memory, closing the connection destroys the - # database. To prevent accidental data loss, ignore close requests on - # an in-memory db. - if self.settings_dict['NAME'] != ":memory:": - BaseDatabaseWrapper.close(self) + def is_usable(self): + return True + FORMAT_QMARK_REGEX = re.compile(r'(?<!%)%s') |
