Updated widgets for z3c.form >= 3.6
authorThierry Florac <thierry.florac@onf.fr>
Wed, 10 Jan 2018 12:44:32 +0100
changeset 12 77e093529691
parent 11 54513667faec
child 13 aa02c3117e2c
Updated widgets for z3c.form >= 3.6
src/pyams_gis/widget/area.py
src/pyams_gis/widget/point.py
src/pyams_gis/widget/templates/geoarea-input.pt
src/pyams_gis/widget/templates/geopoint-input.pt
--- a/src/pyams_gis/widget/area.py	Mon Dec 11 15:26:52 2017 +0100
+++ b/src/pyams_gis/widget/area.py	Wed Jan 10 12:44:32 2018 +0100
@@ -56,7 +56,7 @@
 
     def updateWidgets(self, setErrors=True):
         super(GeoAreaWidget, self).updateWidgets()
-        widgets = self.widgets
+        widgets = self.subform.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'
--- a/src/pyams_gis/widget/point.py	Mon Dec 11 15:26:52 2017 +0100
+++ b/src/pyams_gis/widget/point.py	Wed Jan 10 12:44:32 2018 +0100
@@ -56,7 +56,7 @@
 
     def updateWidgets(self, setErrors=True):
         super(GeoPointWidget, self).updateWidgets(setErrors)
-        widgets = self.widgets
+        widgets = self.subform.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'}
@@ -106,7 +106,7 @@
 
     def updateWidgets(self, setErrors=True):
         super(GeoPointZWidget, self).updateWidgets(setErrors)
-        widgets = self.widgets
+        widgets = self.subform.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'
--- a/src/pyams_gis/widget/templates/geoarea-input.pt	Mon Dec 11 15:26:52 2017 +0100
+++ b/src/pyams_gis/widget/templates/geoarea-input.pt	Wed Jan 10 12:44:32 2018 +0100
@@ -42,7 +42,7 @@
 				</div>
 			</div>
 		</div>
-		<tal:loop repeat="widget view/widgets/values">
+		<tal:loop repeat="widget view/subform/widgets/values">
 			<input type="hidden"
 				   tal:condition="python:widget.mode == 'hidden'"
 				   tal:replace="structure widget/render" />
--- a/src/pyams_gis/widget/templates/geopoint-input.pt	Mon Dec 11 15:26:52 2017 +0100
+++ b/src/pyams_gis/widget/templates/geopoint-input.pt	Wed Jan 10 12:44:32 2018 +0100
@@ -42,7 +42,7 @@
 				</div>
 			</div>
 		</div>
-		<tal:loop repeat="widget view/widgets/values">
+		<tal:loop repeat="widget view/subform/widgets/values">
 			<input type="hidden"
 				   tal:condition="python:widget.mode == 'hidden'"
 				   tal:replace="structure widget/render" />