Serializers Package¶
Submodules¶
Serializers¶
:copyright (c) 2014 - 2022, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Department of Energy) and contributors. All rights reserved. :author
- class seed.serializers.celery.CeleryDatetimeSerializer(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)¶
Bases:
json.encoder.JSONEncoder
- default(obj)¶
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
- static seed_decoder(obj)¶
- static seed_dumps(obj)¶
- static seed_loads(obj)¶
Labels¶
:copyright (c) 2014 - 2022, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Department of Energy) and contributors. All rights reserved. :author
- class seed.serializers.labels.LabelSerializer(*args, **kwargs)¶
Bases:
rest_framework.serializers.ModelSerializer
- class Meta¶
Bases:
object
- extra_kwargs = {'super_organization': {'write_only': True}}¶
- fields = ('id', 'name', 'color', 'organization_id', 'super_organization', 'is_applied', 'show_in_list')¶
- model¶
alias of
seed.models.models.StatusLabel
- get_is_applied(obj)¶
- to_representation(instance)¶
Object instance -> Dict of primitive datatypes.
Module contents¶
:copyright (c) 2014 - 2022, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Department of Energy) and contributors. All rights reserved. :author