app.serializers.role.RoleSerializer
- class app.serializers.role.RoleSerializer(*, only: Optional[Union[Sequence[str], Set[str]]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Optional[Dict] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Optional[str] = None)
Bases:
flask_marshmallow.schema.Schema
Attributes
Overrides for default schema-level error messages
Methods
RoleSerializer.__init__
(*[, only, exclude, ...])RoleSerializer.dump
(obj, *[, many])Serialize an object to native Python data types according to this Schema's fields.
RoleSerializer.dumps
(obj, *args[, many])Same as
dump()
, except return a JSON-encoded string.RoleSerializer.from_dict
(fields, *[, name])Generate a Schema class given a dictionary of fields.
RoleSerializer.get_attribute
(obj, attr, default)Defines how to pull values from an object to serialize.
RoleSerializer.handle_error
(error, data, *, ...)Custom error handler function for the schema.
RoleSerializer.jsonify
(obj[, many])Return a JSON response containing the serialized data.
RoleSerializer.load
(data, *[, many, ...])Deserialize a data structure to an object defined by this Schema's fields.
RoleSerializer.loads
(json_data, *[, many, ...])Same as
load()
, except it takes a JSON string as input.RoleSerializer.on_bind_field
(field_name, ...)Hook to modify a field when it is bound to the Schema.
RoleSerializer.sluglify_name
(item, many, ...)RoleSerializer.validate
(data, *[, many, partial])Validate data against the schema, returning a dictionary of validation errors.
RoleSerializer.validate_id
(role_id)RoleSerializer.validate_name
(value, **kwargs)