Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reverted [7151] since it breaks exact IP lookups on PostgreSQL. Reopens

#708

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f7fbc289ad7e13436f17939046cd1adfe438b126 1 parent 00f0519
@jacobian jacobian authored
View
5 django/db/backends/postgresql/operations.py
@@ -27,11 +27,6 @@ def date_trunc_sql(self, lookup_type, field_name):
def deferrable_sql(self):
return " DEFERRABLE INITIALLY DEFERRED"
- def field_cast_sql(self, db_type):
- if db_type == 'inet':
- return 'CAST(%s AS TEXT)'
- 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]
View
8 tests/regressiontests/string_lookup/models.py
@@ -39,7 +39,6 @@ def __unicode__(self):
class Article(models.Model):
name = models.CharField(max_length=50)
text = models.TextField()
- submitted_from = models.IPAddressField(blank=True, null=True)
def __str__(self):
return "Article %s" % self.name
@@ -99,11 +98,4 @@ def __str__(self):
>>> Article.objects.get(text__contains='quick brown fox')
<Article: Article Test>
-
-# Regression test for #708: "like" queries on IP address fields require casting
-# to text (on PostgreSQL).
->>> Article(name='IP test', text='The body', submitted_from='192.0.2.100').save()
->>> Article.objects.filter(submitted_from__contains='192.0.2')
-[<Article: Article IP test>]
-
"""}
Please sign in to comment.
Something went wrong with that request. Please try again.