Changeset 7980 for django/branches/gis/django/contrib/gis/db/models
- Timestamp:
- 07/19/08 09:17:24 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/db/models/fields/__init__.py
r7840 r7980 1 from django.contrib.gis import forms 1 2 from django.db import connection 2 3 # Getting the SpatialBackend container and the geographic quoting method. … … 112 113 raise ValueError('Could not create geometry from lookup value: %s' % str(value)) 113 114 else: 114 raise TypeError('Cannot use parameter of `%s` type as a geometrylookup parameter.' % type(value))115 raise TypeError('Cannot use parameter of `%s` type as lookup parameter.' % type(value)) 115 116 116 117 # Assigning the SRID value. … … 137 138 # Setup for lazy-instantiated Geometry object. 138 139 setattr(cls, self.attname, GeometryProxy(SpatialBackend.Geometry, self)) 140 141 def formfield(self, **kwargs): 142 defaults = {'form_class' : forms.GeometryField, 143 'geom_type' : self._geom, 144 'null' : self.null, 145 } 146 defaults.update(kwargs) 147 return super(GeometryField, self).formfield(**defaults) 139 148 140 149 def get_db_prep_lookup(self, lookup_type, value):
