Skip to content

history.apps ​

Overview ​

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

Classes ​

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(model, exclude_fields)

Parameters ​

NameTypeRequiredDefaultDescription
modelyes
exclude_fieldsno()

Source ​

server/vueda/history/apps.py:99

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