Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8904 -- Improved error message when spatial lookup is not avai…

…lable, and changed exception to `ValueError` to prevent swallowing of error on queryset evaluation.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 539cfe8cb73f777a24ac2f631a518a343be03a9a 1 parent 7e52657
Justin Bronn authored March 30, 2010

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  django/contrib/gis/db/models/fields.py
3  django/contrib/gis/db/models/fields.py
@@ -241,7 +241,8 @@ def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
241 241
 
242 242
             return params
243 243
         else:
244  
-            raise TypeError("Field has invalid lookup: %s" % lookup_type)
  244
+            raise ValueError('%s is not a valid spatial lookup for %s.' %
  245
+                             (lookup_type, self.__class__.__name__))
245 246
 
246 247
     def get_prep_lookup(self, lookup_type, value):
247 248
         if lookup_type == 'isnull':

0 notes on commit 539cfe8

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