From 22e016ff6c18a35a450519b94de63033f83e6b4f Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Thu, 28 Feb 2008 21:24:51 +0000 Subject: gis: Merged revisions 7105-7168 via svnmerge from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7176 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/mysql/base.py | 1 - django/db/backends/postgresql/operations.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'django/db/backends') diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index ba3e9efda8..697dcd3a67 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -21,7 +21,6 @@ if (version < (1,2,1) or (version[:3] == (1, 2, 1) and from MySQLdb.converters import conversions from MySQLdb.constants import FIELD_TYPE -import types import re # Raise exceptions for database warnings if DEBUG is on diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py index 20392b238e..15ca957bac 100644 --- a/django/db/backends/postgresql/operations.py +++ b/django/db/backends/postgresql/operations.py @@ -27,6 +27,11 @@ class DatabaseOperations(BaseDatabaseOperations): def deferrable_sql(self): return " DEFERRABLE INITIALLY DEFERRED" + def field_cast_sql(self, db_type): + if db_type == 'inet': + return 'HOST(%s)' + return '%s' + def last_insert_id(self, cursor, table_name, pk_name): cursor.execute("SELECT CURRVAL('\"%s_%s_seq\"')" % (table_name, pk_name)) return cursor.fetchone()[0] -- cgit v1.3