---
url: "https://vueda.dev/v3/reference/api/py/vueda.history.apps.md"
title: "history.apps"
---

# history.apps

## Overview

AppConfig for the vueda.history application, and its ``class Vueda`` feature section.

## Classes

- [HistoryConfig](/v3/reference/api/py/vueda.history.apps/HistoryConfig.md)

## `track_model` {#track_model}

Register pghistory event models and triggers for ``model`` under VUEDA's backend policy.

Two callers reach this. The ``class Vueda.History`` contributor calls it for every model in the
feature-policy family. A model outside that family calls it directly, which is how workflow's
configuration and object-state records get event models that share the context field,
append-only behaviour, and mandatory exclusions of a policy-driven model.

Call it on a prepared model. The contributor runs on ``class_prepared``, and a direct caller
writes the call after the class body, so pghistory sees every field either way. The trackers are
built per call rather than shared, because a tracker resolves its trigger condition against the
first model it is applied to and keeps it, which leaks one model's field list into the next.

Returns ``model``, so a caller can register and re-export in one statement.

### Signature {#track_model-signature}

`track_model(model, exclude_fields)`

#### Parameters {#track_model-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="track_model-param-model">model</span> |  | yes |  |  |
| <span id="track_model-param-exclude_fields">exclude_fields</span> |  | no | `()` |  |

### Source {#track_model-source}

`server/vueda/history/apps.py:99`

## `HISTORY_SECTION` {#HISTORY_SECTION}

The ``History`` section of ``class Vueda``, which controls change history for a model.

Its options are ``enabled`` (default ``True``) to record insert, update, and delete events,
``exclude_fields`` (default empty) to leave fields out of the recorded events, and ``reason``
(default empty), a note on why the model has this policy that VUEDA does not read. A composite
primary key needs ``enabled = False``.

## Source

`server/vueda/history/apps.py`
