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/postgresql.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/postgresql.py')
| -rw-r--r-- | django/core/db/backends/postgresql.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/django/core/db/backends/postgresql.py b/django/core/db/backends/postgresql.py index a1de11e3df..b6d34fc814 100644 --- a/django/core/db/backends/postgresql.py +++ b/django/core/db/backends/postgresql.py @@ -49,6 +49,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 dictfetchone(cursor): "Returns a row from the cursor as a dict" return cursor.dictfetchone() @@ -116,11 +121,6 @@ def get_relations(cursor, table_name): continue return relations -def quote_name(name): - if name.startswith('"') and name.endswith('"'): - return name # Quoting once is enough. - return '"%s"' % name - # Register these custom typecasts, because Django expects dates/times to be # in Python's native (standard-library) datetime/time format, whereas psycopg # use mx.DateTime by default. |
