StripField

Take a field from a dictionary, removing the key from the dictionary.

name is the key. The field value and a new copy of the dictionary with that field removed are returned.

>>> StripField('test').to_python({'a': 1, 'test': 2})
(2, {'a': 1})
>>> StripField('test').to_python({})
Traceback (most recent call last):
    ...
Invalid: The name 'test' is missing

Messages

badType:
The input must be a string (not a %(type)s: %(value)r)
empty:
Please enter a value
missing:
The name %(name)s is missing
noneType:
The input must be a string (not None)

Attributes

a gettextargs

{}

a strip

False

a use_builtins_gettext

True

a accept_python

True

a __singletonmethods__

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

a declarative_count

40

a __unpackargs__

('name',)

a compound

False

a not_empty

False

a __mutableattributes__

()

a repeating

False

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 is_empty(self, value) ...

See the source for more information.