restapi.models.fields.List.serialize
- List.serialize(attr, obj, accessor=None, **kwargs)
Pulls the value for the given key from the object, applies the field’s formatting and returns the result.
- Parameters:
attr (
str) – The attribute/key to get from the object.obj (
Any) – The object to access the attribute/key from.accessor (
Optional[Callable[[Any,str,Any],Any]], default:None) – Function used to access values fromobj.kwargs – Field-specific keyword arguments.