# HG changeset patch # User Thierry Florac # Date 1495324397 -7200 # Node ID bf796b698a98050d48a61c4e01cdf4c4023350ef # Parent c73bb834ccbeb1f91b110f5623d37186ab1c5b2d Switch to release 3.4.0 of z3c.form, which removes 'subform' inner attribute and handles object factories in a different way diff -r c73bb834ccbe -r bf796b698a98 src/pyams_gis/widget/area.py --- a/src/pyams_gis/widget/area.py Thu May 18 17:23:48 2017 +0200 +++ b/src/pyams_gis/widget/area.py Sun May 21 01:53:17 2017 +0200 @@ -46,10 +46,7 @@ self.widget = widget def __call__(self, data): - result = GeoArea() - for name, value in data.items(): - setattr(result, name, value) - return result + return GeoArea() @widgettemplate_config(mode='input', template='templates/geoarea-input.pt', layer=IFormLayer) @@ -59,7 +56,7 @@ def updateWidgets(self, setErrors=True): super(GeoAreaWidget, self).updateWidgets() - widgets = self.subform.widgets + widgets = self.widgets widgets['x1'].input_css_class = 'col-md-2' widgets['y1'].input_css_class = 'col-md-2' widgets['x2'].input_css_class = 'col-md-2' diff -r c73bb834ccbe -r bf796b698a98 src/pyams_gis/widget/point.py --- a/src/pyams_gis/widget/point.py Thu May 18 17:23:48 2017 +0200 +++ b/src/pyams_gis/widget/point.py Sun May 21 01:53:17 2017 +0200 @@ -46,10 +46,7 @@ self.widget = widget def __call__(self, data): - result = GeoPoint() - for name, value in data.items(): - setattr(result, name, value) - return result + return GeoPoint() @widgettemplate_config(mode='input', template='templates/geopoint-input.pt', layer=IFormLayer) @@ -59,7 +56,7 @@ def updateWidgets(self, setErrors=True): super(GeoPointWidget, self).updateWidgets(setErrors) - widgets = self.subform.widgets + widgets = self.widgets widgets['longitude'].input_css_class = 'col-md-2' widgets['latitude'].input_css_class = 'col-md-2' widgets['longitude'].object_data = {'ams-change-handler': 'PyAMS_GIS.position.changedCoordinate'} @@ -99,10 +96,7 @@ self.widget = widget def __call__(self, data): - result = GeoPointZ() - for name, value in data.items(): - setattr(result, name, value) - return result + return GeoPointZ() @widgettemplate_config(mode='input', template='templates/geopoint-input.pt', layer=IFormLayer) @@ -112,7 +106,7 @@ def updateWidgets(self, setErrors=True): super(GeoPointZWidget, self).updateWidgets(setErrors) - widgets = self.subform.widgets + widgets = self.widgets widgets['longitude'].input_css_class = 'col-md-2' widgets['latitude'].input_css_class = 'col-md-2' widgets['altitude'].input_css_class = 'col-md-2' diff -r c73bb834ccbe -r bf796b698a98 src/pyams_gis/widget/templates/geoarea-input.pt --- a/src/pyams_gis/widget/templates/geoarea-input.pt Thu May 18 17:23:48 2017 +0200 +++ b/src/pyams_gis/widget/templates/geoarea-input.pt Sun May 21 01:53:17 2017 +0200 @@ -42,7 +42,7 @@ - + diff -r c73bb834ccbe -r bf796b698a98 src/pyams_gis/widget/templates/geopoint-input.pt --- a/src/pyams_gis/widget/templates/geopoint-input.pt Thu May 18 17:23:48 2017 +0200 +++ b/src/pyams_gis/widget/templates/geopoint-input.pt Sun May 21 01:53:17 2017 +0200 @@ -42,7 +42,7 @@ - +