app.serializers.core.TimestampField

class app.serializers.core.TimestampField(*, load_default: Any = <marshmallow.missing>, missing: Any = <marshmallow.missing>, dump_default: Any = <marshmallow.missing>, default: Any = <marshmallow.missing>, data_key: Optional[str] = None, attribute: Optional[str] = None, validate: Optional[Union[Callable[[Any], Any], Iterable[Callable[[Any], Any]]]] = None, required: bool = False, allow_none: Optional[bool] = None, load_only: bool = False, dump_only: bool = False, error_messages: Optional[Dict[str, str]] = None, metadata: Optional[Mapping[str, Any]] = None, **additional_metadata)

Bases: marshmallow.fields.Field

Field that serializes to timestamp integer and deserializes to a datetime.datetime class.

Attributes

TimestampField.context

The context dictionary for the parent Schema.

TimestampField.default

TimestampField.default_error_messages

Default error messages for various kinds of errors.

TimestampField.missing

TimestampField.name

TimestampField.parent

TimestampField.root

Methods

TimestampField.__init__(*[, load_default, ...])

TimestampField.deserialize(value[, attr, data])

Deserialize value.

TimestampField.fail(key, **kwargs)

Helper method that raises a ValidationError with an error message from self.error_messages.

TimestampField.get_value(obj, attr[, ...])

Return the value for a given key from an object.

TimestampField.make_error(key, **kwargs)

Helper method to make a ValidationError with an error message from self.error_messages.

TimestampField.serialize(attr, obj[, accessor])

Pulls the value for the given key from the object, applies the field's formatting and returns the result.