restapi.models.fields.List
- class restapi.models.fields.List(cls_or_instance, *, unique=False, min_items=0, **kwargs)[source]
- Parameters:
cls_or_instance (
Union[Field,type])unique (
bool, default:False)min_items (
int, default:0)kwargs (
Any)
- __init__(cls_or_instance, *, unique=False, min_items=0, **kwargs)[source]
- Parameters:
cls_or_instance (
Union[Field,type])unique (
bool, default:False)min_items (
int, default:0)kwargs (
Any)
- Return type:
None
Methods
__init__(cls_or_instance, *[, unique, min_items])deserialize(value[, attr, data])Deserialize
value.fail(key, **kwargs)Helper method that raises a ValidationError with an error message from
self.error_messages.get_value(obj, attr[, accessor, default])Return the value for a given key from an object.
make_error(key, **kwargs)Helper method to make a ValidationError with an error message from
self.error_messages.serialize(attr, obj[, accessor])Pulls the value for the given key from the object, applies the field's formatting and returns the result.
Attributes
The context dictionary for the parent
Schema.Default error messages.