From efd1e6096ee87fe332cf989ba5479e9461d0fb3a Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 6 Sep 2013 15:27:51 -0500 Subject: Adding 'sqlmigrate' command and quote_parameter to support it. --- django/db/backends/postgresql_psycopg2/operations.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'django/db/backends/postgresql_psycopg2/operations.py') diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py index cc78ffe449..723453c9c5 100644 --- a/django/db/backends/postgresql_psycopg2/operations.py +++ b/django/db/backends/postgresql_psycopg2/operations.py @@ -98,6 +98,11 @@ class DatabaseOperations(BaseDatabaseOperations): return name # Quoting once is enough. return '"%s"' % name + def quote_parameter(self, value): + # Inner import so backend fails nicely if it's not present + import psycopg2 + return psycopg2.extensions.adapt(value) + def set_time_zone_sql(self): return "SET TIME ZONE %s" -- cgit v1.2.1