diff options
| author | Justin Bronn <jbronn@gmail.com> | 2010-03-30 01:13:47 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2010-03-30 01:13:47 +0000 |
| commit | 539cfe8cb73f777a24ac2f631a518a343be03a9a (patch) | |
| tree | f684552bbb5a0956e9f1cf7633bc356d555777f5 | |
| parent | 7e5265785a7be403d84b3d8b2d23e295aa1f7d56 (diff) | |
Fixed #8904 -- Improved error message when spatial lookup is not available, 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
| -rw-r--r-- | django/contrib/gis/db/models/fields.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/gis/db/models/fields.py b/django/contrib/gis/db/models/fields.py index 0fd4c8b14d..2b1660763a 100644 --- a/django/contrib/gis/db/models/fields.py +++ b/django/contrib/gis/db/models/fields.py @@ -241,7 +241,8 @@ class GeometryField(Field): return params else: - raise TypeError("Field has invalid lookup: %s" % lookup_type) + raise ValueError('%s is not a valid spatial lookup for %s.' % + (lookup_type, self.__class__.__name__)) def get_prep_lookup(self, lookup_type, value): if lookup_type == 'isnull': |
