diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-11-13 05:11:41 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-11-13 05:11:41 +0000 |
| commit | 3273c981f8d370ce6ccc6cbd8a20fea4f9d64de0 (patch) | |
| tree | c9c6de0de91e931bd3af33fbe5aeaf8eb030506e /django/core/db/backends/mysql.py | |
| parent | 29bdbc3dbffed238546b1ea1163a95139d50236f (diff) | |
Moved db.quote_name from a model-level function to a method of DatabaseWrapper for all database backends, so quote_name will be accessible in a 'from django.core.db import db' context
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1213 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/db/backends/mysql.py')
| -rw-r--r-- | django/core/db/backends/mysql.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/django/core/db/backends/mysql.py b/django/core/db/backends/mysql.py index e7ede84a12..dd94948b96 100644 --- a/django/core/db/backends/mysql.py +++ b/django/core/db/backends/mysql.py @@ -84,6 +84,11 @@ class DatabaseWrapper: self.connection.close() self.connection = None + def quote_name(self, name): + if name.startswith("`") and name.endswith("`"): + return name # Quoting once is enough. + return "`%s`" % name + def get_last_insert_id(cursor, table_name, pk_name): cursor.execute("SELECT LAST_INSERT_ID()") return cursor.fetchone()[0] @@ -122,11 +127,6 @@ def get_table_list(cursor): def get_relations(cursor, table_name): raise NotImplementedError -def quote_name(name): - if name.startswith("`") and name.endswith("`"): - return name # Quoting once is enough. - return "`%s`" % name - OPERATOR_MAPPING = { 'exact': '=', 'iexact': 'LIKE', |
