Permalink
Browse files

Prevented rendering attrs to be squashed in OSMWidget

  • Loading branch information...
1 parent 6ecbac2 commit b6889c68d7af2e3b8efa01f7050c068afe015080 @claudep claudep committed Sep 3, 2013
@@ -111,5 +111,10 @@ def map_srid(self):
return 900913
def render(self, name, value, attrs=None):
- return super(OSMWidget, self).render(name, value,
- {'default_lon': self.default_lon, 'default_lat': self.default_lat})
+ default_attrs = {
+ 'default_lon': self.default_lon,
+ 'default_lat': self.default_lat,
+ }
+ if attrs:
+ default_attrs.update(attrs)
+ return super(OSMWidget, self).render(name, value, default_attrs)
@@ -213,7 +213,7 @@ function MapWidget(options) {
var styleMap = new OpenLayers.StyleMap({'default': OpenLayers.Util.applyDefaults(defaults_style, OpenLayers.Feature.Vector.style['default'])});
this.layers.vector = new OpenLayers.Layer.Vector(" " + this.options.name, {styleMap: styleMap});
this.map.addLayer(this.layers.vector);
- wkt = document.getElementById(this.options.id).value;
+ var wkt = document.getElementById(this.options.id).value;
if (wkt) {
var feat = OpenLayers.Util.properFeatures(this.read_wkt(wkt), this.options.geom_type);
this.write_wkt(feat);
@@ -250,7 +250,9 @@ class PointForm(forms.Form):
geom = self.geometries['point']
form = PointForm(data={'p': geom})
- self.assertIn("OpenStreetMap (Mapnik)", form.as_p())
+ rendered = form.as_p()
+ self.assertIn("OpenStreetMap (Mapnik)", rendered)
+ self.assertIn("id: 'id_p',", rendered)
@skipUnless(HAS_GDAL and HAS_SPATIALREFSYS,

0 comments on commit b6889c6

Please sign in to comment.