From 23bb8c4a4b5e785cd4992689c529f2d9a86898b2 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 1 Nov 2005 01:32:54 +0000 Subject: Added quote_name hook for each database backend. Refs #121. Thanks, Robin Munn -- we miss you. git-svn-id: http://code.djangoproject.com/svn/django/trunk@1039 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/db/backends/postgresql.py | 5 +++++ 1 file changed, 5 insertions(+) (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 c922fd42f6..a1de11e3df 100644 --- a/django/core/db/backends/postgresql.py +++ b/django/core/db/backends/postgresql.py @@ -116,6 +116,11 @@ 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