Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed references to deprecated `GeometryField` atribute in `GeoMode…

…lAdmin`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8010e0c32ee9ba5a0199ee477242b00f1d6627fd 1 parent 44c0623
@jbronn jbronn authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 django/contrib/gis/admin/options.py
View
16 django/contrib/gis/admin/options.py
@@ -66,29 +66,29 @@ def get_map_widget(self, db_field):
in the `widget` attribute) using the settings from the attributes set
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 db_field._geom == 'GEOMETRYCOLLECTION': collection_type = 'Any'
- else: collection_type = OGRGeomType(db_field._geom.replace('MULTI', ''))
+ if db_field.geom_type == 'GEOMETRYCOLLECTION': collection_type = 'Any'
+ else: collection_type = OGRGeomType(db_field.geom_type.replace('MULTI', ''))
else:
collection_type = 'None'
class OLMap(self.widget):
template = self.map_template
- geom_type = db_field._geom
+ geom_type = db_field.geom_type
params = {'default_lon' : self.default_lon,
'default_lat' : self.default_lat,
'default_zoom' : self.default_zoom,
'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,
'is_collection' : is_collection,
'scrollable' : self.scrollable,
'layerswitcher' : self.layerswitcher,
'collection_type' : collection_type,
- 'is_linestring' : db_field._geom in ('LINESTRING', 'MULTILINESTRING'),
- 'is_polygon' : db_field._geom in ('POLYGON', 'MULTIPOLYGON'),
- 'is_point' : db_field._geom in ('POINT', 'MULTIPOINT'),
+ 'is_linestring' : db_field.geom_type in ('LINESTRING', 'MULTILINESTRING'),
+ 'is_polygon' : db_field.geom_type in ('POLYGON', 'MULTIPOLYGON'),
+ 'is_point' : db_field.geom_type in ('POINT', 'MULTIPOINT'),
'num_zoom' : self.num_zoom,
'max_zoom' : self.max_zoom,
'min_zoom' : self.min_zoom,
Please sign in to comment.
Something went wrong with that request. Please try again.