Commits

Reed O'Brien committed c11a39e

avert unnecessary future support questions

Comments (0)

Files changed (3)

         whatever is passed as ``name``.  E.g. if ``name`` is passed as
         ``submit``, ``title`` will be ``Submit``.
 
-    type_
+    type
         The value used as the type of button. The HTML spec supports 
         ``submit``, ``reset`` and ``button``. Default: ``submit``. 
 
         ``value`` attribute of the button or input tag resulting from
         a form rendering).  Default: same as ``name`` passed.
     """
-    def __init__(self, name='submit', title=None, type_='submit', value=None):
+    def __init__(self, name='submit', title=None, type='submit', value=None):
         if title is None:
             title = name.capitalize()
         if value is None:
             value = name
         self.name = name
         self.title = title
-        self.type_ = type_
+        self.type = type
         self.value = value

deform/templates/form.pt

           <button 
               id="${field.formid+button.name}"
               name="${button.name}"
-              type="${button.type_}"
+              type="${button.type}"
               class="btnText submit"
               value="${button.value}">
             <span>${button.title}</span>

deform/tests/test_form.py

 
     def test_ctor_type_None(self):
         button = self._makeOne()
-        self.assertEqual(button.type_, 'submit')
+        self.assertEqual(button.type, 'submit')
 
     def test_ctor_value_None(self):
         button = self._makeOne()
 
     def test_ctor(self):
         button = self._makeOne(name='name', title='title', 
-                               type_='type', value='value')
+                               type='type', value='value')
         self.assertEqual(button.value, 'value')
         self.assertEqual(button.name, 'name')
         self.assertEqual(button.title, 'title')
-        self.assertEqual(button.type_, 'type')
+        self.assertEqual(button.type, 'type')
 
 class TestRaw(unittest.TestCase):
     def _makeOne(self, val):