Skip to content

VuedaReadonlySerializer ​

Overview ​

Read-only variant of VuedaSerializer. Disables create and update, and marks all fields as read-only. Use for nested expansions that must not be written through the parent serializer.

Meta ​

Source ​

server/vueda/core/serializers/__init__.py:1155

get_field_names ​

Returns the list of all field names that should be created when instantiating this serializer class. This is based on the default set of fields, but also takes into account the Meta.fields or Meta.exclude options if they have been specified.

Signature ​

get_field_names(self, declared_fields, info)

Parameters ​

NameTypeRequiredDefaultDescription
selfyes
declared_fieldsyes
infoyes

Source ​

server/vueda/core/serializers/__init__.py:1160

validate_empty_values ​

Validate empty values, and either:

  • Raise ValidationError, indicating invalid data.
  • Raise SkipField, indicating that the field should be ignored.
  • Return (True, data), indicating an empty value that should be returned without any further validation being applied.
  • Return (False, data), indicating a non-empty value, that should have validation applied as normal.

Signature ​

validate_empty_values(self, data)

Parameters ​

NameTypeRequiredDefaultDescription
selfyes
datayes

Source ​

server/vueda/core/serializers/__init__.py:1176

Source ​

server/vueda/core/serializers/__init__.py:1146