Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Jacob Kaplan-Moss authored February 26, 2008
5  django/db/backends/postgresql/operations.py
@@ -27,11 +27,6 @@ def date_trunc_sql(self, lookup_type, field_name):
27 27
     def deferrable_sql(self):
28 28
         return " DEFERRABLE INITIALLY DEFERRED"
29 29
 
30  
-    def field_cast_sql(self, db_type):
31  
-        if db_type == 'inet':
32  
-            return 'CAST(%s AS TEXT)'
33  
-        return '%s'
34  
-
35 30
     def last_insert_id(self, cursor, table_name, pk_name):
36 31
         cursor.execute("SELECT CURRVAL('\"%s_%s_seq\"')" % (table_name, pk_name))
37 32
         return cursor.fetchone()[0]
8  tests/regressiontests/string_lookup/models.py
@@ -39,7 +39,6 @@ def __unicode__(self):
39 39
 class Article(models.Model):
40 40
     name = models.CharField(max_length=50)
41 41
     text = models.TextField()
42  
-    submitted_from = models.IPAddressField(blank=True, null=True)
43 42
 
44 43
     def __str__(self):
45 44
         return "Article %s" % self.name
@@ -99,11 +98,4 @@ def __str__(self):
99 98
 
100 99
 >>> Article.objects.get(text__contains='quick brown fox')
101 100
 <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  
-
109 101
 """}

0 notes on commit f7fbc28

Please sign in to comment.
Something went wrong with that request. Please try again.