Removed references to deprecated `GeometryField` atribute in `GeoModelAdmin`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2009-04-24 20:34:48 +00:00
parent 44c062344f
commit 8010e0c32e
1 changed files with 8 additions and 8 deletions

View File

@ -66,29 +66,29 @@ class GeoModelAdmin(ModelAdmin):
in the `widget` attribute) using the settings from the attributes set in the `widget` attribute) using the settings from the attributes set
in this class. in this class.
""" """
is_collection = db_field._geom in ('MULTIPOINT', 'MULTILINESTRING', 'MULTIPOLYGON', 'GEOMETRYCOLLECTION') is_collection = db_field.geom_type in ('MULTIPOINT', 'MULTILINESTRING', 'MULTIPOLYGON', 'GEOMETRYCOLLECTION')
if is_collection: if is_collection:
if db_field._geom == 'GEOMETRYCOLLECTION': collection_type = 'Any' if db_field.geom_type == 'GEOMETRYCOLLECTION': collection_type = 'Any'
else: collection_type = OGRGeomType(db_field._geom.replace('MULTI', '')) else: collection_type = OGRGeomType(db_field.geom_type.replace('MULTI', ''))
else: else:
collection_type = 'None' collection_type = 'None'
class OLMap(self.widget): class OLMap(self.widget):
template = self.map_template template = self.map_template
geom_type = db_field._geom geom_type = db_field.geom_type
params = {'default_lon' : self.default_lon, params = {'default_lon' : self.default_lon,
'default_lat' : self.default_lat, 'default_lat' : self.default_lat,
'default_zoom' : self.default_zoom, 'default_zoom' : self.default_zoom,
'display_wkt' : self.debug or self.display_wkt, 'display_wkt' : self.debug or self.display_wkt,
'geom_type' : OGRGeomType(db_field._geom), 'geom_type' : OGRGeomType(db_field.geom_type),
'field_name' : db_field.name, 'field_name' : db_field.name,
'is_collection' : is_collection, 'is_collection' : is_collection,
'scrollable' : self.scrollable, 'scrollable' : self.scrollable,
'layerswitcher' : self.layerswitcher, 'layerswitcher' : self.layerswitcher,
'collection_type' : collection_type, 'collection_type' : collection_type,
'is_linestring' : db_field._geom in ('LINESTRING', 'MULTILINESTRING'), 'is_linestring' : db_field.geom_type in ('LINESTRING', 'MULTILINESTRING'),
'is_polygon' : db_field._geom in ('POLYGON', 'MULTIPOLYGON'), 'is_polygon' : db_field.geom_type in ('POLYGON', 'MULTIPOLYGON'),
'is_point' : db_field._geom in ('POINT', 'MULTIPOINT'), 'is_point' : db_field.geom_type in ('POINT', 'MULTIPOINT'),
'num_zoom' : self.num_zoom, 'num_zoom' : self.num_zoom,
'max_zoom' : self.max_zoom, 'max_zoom' : self.max_zoom,
'min_zoom' : self.min_zoom, 'min_zoom' : self.min_zoom,