Package coprs :: Package rest_api :: Module schemas :: Class BuiltPackages
[hide private]
[frames] | no frames]

Class BuiltPackages

source code


stored in db as a string:
    "python3-marshmallow 2.0.0b5
python-marshmallow 2.0.0b5"
    we would represent them as
    { name: "pkg", version: "pkg version" }
    we implement only the serialization, since field is read-only
    

Instance Methods [hide private]
 
_serialize(self, value, attr, obj)
Serializes ``value`` to a basic Python datatype.
source code

Inherited from marshmallow.fields.Field: __init__, __repr__, deserialize, get_value, serialize

Inherited from marshmallow.fields.Field (private): _add_to_schema, _deserialize, _validate, _validate_missing

Inherited from marshmallow.base.FieldABC: __deepcopy__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from marshmallow.fields.Field (private): _CHECK_ATTRIBUTE, _creation_index

Inherited from marshmallow.base.FieldABC: name, parent

Properties [hide private]

Inherited from marshmallow.fields.Field: context

Inherited from object: __class__

Method Details [hide private]

_serialize(self, value, attr, obj)

source code 

Serializes ``value`` to a basic Python datatype. Noop by default. Concrete :class:`Field` classes should implement this method.

Example: :

   class TitleCase(Field):
       def _serialize(self, value, attr, obj):
           if not value:
               return ''
           return unicode(value).title()

:param value: The value to be serialized. :param str attr: The attribute or key on the object to be serialized. :param object obj: The object the value was pulled from. :raise ValidationError: In case of formatting or validation failure.

Overrides: marshmallow.base.FieldABC._serialize