summaryrefslogtreecommitdiff
path: root/webtest/forms.py
diff options
context:
space:
mode:
authorArthur Vuillard <arthur.vuillard@gmail.com>2013-02-21 12:16:42 +0100
committerArthur Vuillard <arthur.vuillard@gmail.com>2013-02-21 12:16:42 +0100
commit2d870cca64ed64ada3803cc1bd6ee72a0c351cfb (patch)
tree74036656b85ce0af0840526afe81f42635f2dda2 /webtest/forms.py
parent88a61f5c199ea57f18c680b1f3b010b5f43a5102 (diff)
downloadwebtest-2d870cca64ed64ada3803cc1bd6ee72a0c351cfb.tar.gz
Deletion of the settable attribute in the form's fields
Diffstat (limited to 'webtest/forms.py')
-rw-r--r--webtest/forms.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/webtest/forms.py b/webtest/forms.py
index da931e1..a2f5429 100644
--- a/webtest/forms.py
+++ b/webtest/forms.py
@@ -32,8 +32,6 @@ class Field(object):
# Dictionary of field types (select, radio, etc) to classes
classes = {}
- settable = True
-
def __init__(self, form, tag, name, pos,
value=None, id=None, **attrs):
self.form = form
@@ -45,10 +43,6 @@ class Field(object):
self.attrs = attrs
def value__set(self, value):
- if not self.settable:
- raise AttributeError(
- "You cannot set the value of the <%s> field %r"
- % (self.tag, self.name))
self._value = value
def force_value(self, value):
@@ -265,12 +259,15 @@ Field.classes['hidden'] = Hidden
class Submit(Field):
"""Field representing ``<input type="submit">`` and ``<button>``"""
- settable = False
-
def value__get(self):
return None
- value = property(value__get)
+ def value__set(self,value):
+ raise AttributeError(
+ "You cannot set the value of the <%s> field %r"
+ % (self.tag, self.name))
+
+ value = property(value__get, value__set)
def value_if_submitted(self):
return self._value