---
url: "https://vueda.dev/v3/reference/api/py/vueda.core.serializers/VuedaReadonlySerializer.md"
title: "VuedaReadonlySerializer"
---

# 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` {#Meta}

### Source {#Meta-source}

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

## `get_field_names` {#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-signature}

`get_field_names(self, declared_fields, info)`

#### Parameters {#get_field_names-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="get_field_names-param-declared_fields">declared_fields</span> |  | yes |  |  |
| <span id="get_field_names-param-info">info</span> |  | yes |  |  |

### Source {#get_field_names-source}

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

## `validate_empty_values` {#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-signature}

`validate_empty_values(self, data)`

#### Parameters {#validate_empty_values-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="validate_empty_values-param-data">data</span> |  | yes |  |  |

### Source {#validate_empty_values-source}

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

## Source

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