Commits

Anonymous committed 3d876dc

different __start__ tags

Comments (0)

Files changed (3)

pyramid_simpleform/renderers.py

         """
         return HTML.tag("div", self.csrf(name), style="display:none;")
 
-    def __start__(self, value=None):
+    def __start__(self, type, name=None):
         """
         Renders peppercorn __start__ hidden tags with given values.
 
         For example:
 
-        form.__start__('series:mapping')
+        form.__start__('mapping', 'series')
         >>> <input type="hidden" name="__start__" value="series:mapping" />
 
-        :versionadded: 0.5
+        :versionadded: 0.7
         """
 
+        value = type
+        if name:
+            value = name + ":" + value
         return self.hidden('__start__', value)
 
 
 
         form.__end__()
         >>> <input type="hidden" name="__end__" />
+
+        :versionadded: 0.7
         """
 
         return self.hidden('__end__', value)

pyramid_simpleform/tests.py

         form = Form(request, SimpleColanderSchema())
         renderer = FormRenderer(form)
 
-        self.assert_(renderer.__start__('series:mapping') == \
+        self.assert_(renderer.__start__('mapping', 'series') == \
                 '<input id="__start__" name="__start__" type="hidden" value="series:mapping" />')
 
     def test_end(self):
 
     
 setup(name='pyramid_simpleform',
-      version='0.6.1',
+      version='0.7',
       description='pyramid_simpleform',
       long_description=README + '\n\n' +  CHANGES,
       classifiers=[