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

# VuedaListSerializer

## Overview

List serializer for ``VuedaSerializer`` subclasses. Annotates the queryset with
``formatted_name`` when the child serializer's model has ``formatted_name_lookup_expression``,
mirroring the annotation that ``VuedaViewSet.get_queryset()`` applies for direct requests.
This ensures ``formatted_name`` is populated even when objects are fetched via a related
manager during expand (which bypasses the viewset queryset).

The annotate is skipped when ``formatted_name`` is already present in the queryset's
annotations -- not only to avoid redundant work, but because annotating a queryset that is
serving a prefetched relation clones it, discarding the cached prefetch result and forcing a
fresh query per row. ``vueda.core.viewsets.build_prefetch_plan`` pre-annotates a to-many
expand's ``Prefetch`` queryset for exactly this reason, so this check finds it already done.

## `to_representation` {#to_representation}

List of object instances -&gt; List of dicts of primitive datatypes.

### Signature {#to_representation-signature}

`to_representation(self, data)`

#### Parameters {#to_representation-parameters}

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

### Source {#to_representation-source}

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

## Source

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