MCPcopy Index your code
hub / github.com/webpy/webpy / validates

Method validates

web/form.py:97–111  ·  view source on GitHub ↗
(self, source=None, _validate=True, **kw)

Source from the content-addressed store, hash-verified

95 return ""
96
97 def validates(self, source=None, _validate=True, **kw):
98 source = source or kw or web.input()
99 out = True
100 for i in self.inputs:
101 v = attrget(source, i.name)
102 if _validate:
103 if not i.validate(v):
104 self.note = i.note
105 return False
106 else:
107 i.set_value(v)
108 if _validate:
109 out = out and self._validate(source)
110 self.valid = out
111 return out
112
113 def _validate(self, value):
114 self.value = value

Callers 3

test_form_validatorsFunction · 0.95
fillMethod · 0.95
__call__Method · 0.80

Calls 4

_validateMethod · 0.95
attrgetFunction · 0.85
validateMethod · 0.80
set_valueMethod · 0.45

Tested by 1

test_form_validatorsFunction · 0.76