Add Form.__contains__()
method
for testing if a field is contained in the form
This commit is contained in:
parent
497c80161d
commit
e6144ea08b
|
@ -364,6 +364,9 @@ class Form(object):
|
||||||
self.action_url = action_url
|
self.action_url = action_url
|
||||||
self.cancel_url = cancel_url
|
self.cancel_url = cancel_url
|
||||||
|
|
||||||
|
def __contains__(self, item):
|
||||||
|
return item in self.fields
|
||||||
|
|
||||||
def set_fields(self, fields):
|
def set_fields(self, fields):
|
||||||
self.fields = FieldList(fields)
|
self.fields = FieldList(fields)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue