comicbox.fields.collection_fields

source module comicbox.fields.collection_fields

Marshmallow collection fields.

Classes

Functions

source case_insensitive_dict(d: dict)dict

Make a dict with string keys case insensitive.

source class ListField(*args: Any, sort: bool = True, sort_keys: tuple[str, …] | list[str] = (), allow_empty: bool = False, **kwargs: Any)

Bases : fields.List

List that guarauntees no empty values.

Add instance variables.

Methods

source staticmethod ListField.get_tag_value(value: Any)Any

Override in XmlListField.

source class DictField(*args: Any, keys: type[fields.Field] | fields.Field = StringField, case_insensitive: bool = True, sort: bool = True, allow_empty_keys: bool = False, allow_empty_values: bool = False, **kwargs: Any)

Bases : fields.Dict

Dict field for nested schemas with case insensitive keys and sorting.

Set flags.

source class StringListField(*args: Any, as_string: bool = False, sort: bool = True, separators: str = ‘’, **kwargs: Any)

Bases : fields.List

A list of non empty strings.

Initialize as a string list.

source class StringSetField()

Bases : StringListField

A set of non-empty strings.

source class IntegerListField(*args: Any, sort: bool = False, **kwargs: Any)

Bases : StringListField

A list of integers.

Use not sorting as the default.

source class LegacyNestedMDStringSetField()

Bases : StringSetField

Copy data from the legacy special nested field.

Methods

source classmethod LegacyNestedMDStringSetField.is_nested_metadata(value: Any)bool

Return if this looks like a json or xml string.