From 3273c981f8d370ce6ccc6cbd8a20fea4f9d64de0 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 13 Nov 2005 05:11:41 +0000 Subject: 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 --- django/core/db/backends/postgresql.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'django/core/db/backends/postgresql.py') 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. -- cgit v1.3