summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql_psycopg2/operations.py
diff options
context:
space:
mode:
authorErik Romijn <eromijn@solidlinks.nl>2013-05-19 13:28:09 +0200
committerErik Romijn <eromijn@solidlinks.nl>2013-05-19 13:28:09 +0200
commit60d94c2a80a68861021526c0fef7fc40e648e81f (patch)
tree0f5a275a384d3c3ad31f9363e7508234d5a7bb36 /django/db/backends/postgresql_psycopg2/operations.py
parent56d6fdbbf50b29bd162fd5ab3296a25127d7af65 (diff)
downloaddjango-60d94c2a80a68861021526c0fef7fc40e648e81f.tar.gz
Fixed #11442 -- Postgresql backend casts all inet types to text
Diffstat (limited to 'django/db/backends/postgresql_psycopg2/operations.py')
-rw-r--r--django/db/backends/postgresql_psycopg2/operations.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py
index b17a0c17bb..f06eec5a1d 100644
--- a/django/db/backends/postgresql_psycopg2/operations.py
+++ b/django/db/backends/postgresql_psycopg2/operations.py
@@ -78,8 +78,8 @@ class DatabaseOperations(BaseDatabaseOperations):
return lookup
- def field_cast_sql(self, db_type):
- if db_type == 'inet':
+ def field_cast_sql(self, db_type, internal_type):
+ if internal_type == "GenericIPAddressField" or internal_type == "IPAddressField":
return 'HOST(%s)'
return '%s'