Skip to content

Commit f7fbc28

Browse files
committed
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
1 parent 00f0519 commit f7fbc28

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

django/db/backends/postgresql/operations.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ def date_trunc_sql(self, lookup_type, field_name):
2727
def deferrable_sql(self):
2828
return " DEFERRABLE INITIALLY DEFERRED"
2929

30-
def field_cast_sql(self, db_type):
31-
if db_type == 'inet':
32-
return 'CAST(%s AS TEXT)'
33-
return '%s'
34-
3530
def last_insert_id(self, cursor, table_name, pk_name):
3631
cursor.execute("SELECT CURRVAL('\"%s_%s_seq\"')" % (table_name, pk_name))
3732
return cursor.fetchone()[0]

tests/regressiontests/string_lookup/models.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def __unicode__(self):
3939
class Article(models.Model):
4040
name = models.CharField(max_length=50)
4141
text = models.TextField()
42-
submitted_from = models.IPAddressField(blank=True, null=True)
4342

4443
def __str__(self):
4544
return "Article %s" % self.name
@@ -99,11 +98,4 @@ def __str__(self):
9998
10099
>>> Article.objects.get(text__contains='quick brown fox')
101100
<Article: Article Test>
102-
103-
# Regression test for #708: "like" queries on IP address fields require casting
104-
# to text (on PostgreSQL).
105-
>>> Article(name='IP test', text='The body', submitted_from='192.0.2.100').save()
106-
>>> Article.objects.filter(submitted_from__contains='192.0.2')
107-
[<Article: Article IP test>]
108-
109101
"""}

0 commit comments

Comments
 (0)