FieldsMatch

Tests that the given fields match, i.e., are identical. Useful for password+confirmation fields. Pass the list of field names in as field_names .

>>> f = FieldsMatch('pass', 'conf')
>>> f.to_python({'pass': 'xx', 'conf': 'xx'})
{'conf': 'xx', 'pass': 'xx'}
>>> f.to_python({'pass': 'xx', 'conf': 'yy'})
Traceback (most recent call last):
    ...
Invalid: conf: Fields do not match

Messages

badType:
The input must be a string (not a %(type)s: %(value)r)
empty:
Please enter a value
invalid:
Fields do not match (should be %(match)s)
invalidNoMatch:
Fields do not match
noneType:
The input must be a string (not None)

Attributes

a strip

False

a use_builtins_gettext

True

a accept_python

True

a validate_partial_python

None

a __singletonmethods__

('to_python', 'from_python', 'message', 'all_messages', 'subvalidators')

a show_match

False

a gettextargs

{}

a declarative_count

47

a __unpackargs__

('*', 'field_names')

a validate_partial_form

True

a compound

False

a not_empty

False

a validate_partial_other

None

a repeating

False

a __mutableattributes__

()

a field_names

None

Methods

f __initargs__(self, new_attrs) ...

f __call__(self, *args, **kw) ...

f __classinit__(cls, new_attrs) ...

f __init__(self, *args, **kw) ...

f __sourcerepr__(self, source, binding=None) ...

f __classsourcerepr__(cls, source, binding=None) ...

f validate_partial(self, field_dict, state) ...

f validate_python(self, field_dict, state) ...

See the source for more information.