Serializers Package
Submodules
Serializers
SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors. See also https://github.com/seed-platform/seed/main/LICENSE.md
- 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:
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
SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors. See also https://github.com/seed-platform/seed/main/LICENSE.md
- class seed.serializers.labels.LabelSerializer(*args, **kwargs)
Bases:
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
StatusLabel
- get_is_applied(obj)
- to_representation(instance)
Object instance -> Dict of primitive datatypes.
Module contents
SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors. See also https://github.com/seed-platform/seed/main/LICENSE.md