api.v1.serializers.account_serializers.BaseAccountSerializer module¶
Module with the BaseAccountSerializer serializer class.
- class api.v1.serializers.account_serializers.BaseAccountSerializer.BaseAccountSerializer(*args, **kwargs)[source]¶
Bases:
ModelSerializerThe base serializer for
core.models.Account.Includes all viable fields from the model. Sets all constraints that must be implemented in all serializers. Other serializers for
core.models.Accountshould inherit from this.- user¶
The
core.models.Account.Account.userfield is included but hidden.
- class Meta[source]¶
Bases:
objectMetadata class for the base serializer.
Contains constraints that must be implemented by all serializers. Other serializer metaclasses should inherit from this.
read_only_fieldsandexcludemust not be shortened in subclasses.- fields = '__all__'¶
Include all fields.
- read_only_fields: Final[list[str]] = ['is_healthy', 'last_error', 'last_error_occurred_at', 'created', 'updated']¶
The
core.models.Account.Account.is_healthy,core.models.Account.Account.createdandcore.models.Account.Account.updatedfields are read-only.
- extra_kwargs = {'password': {'write_only': True}}¶
The
core.models.Account.Account.passwordfield is set to write-only for security reasons.
- _declared_fields = {'user': HiddenField(default=CurrentUserDefault())}¶