history.sources
Overview
Events that belong to an object's history without a foreign key to the object.
pghistory finds an object's events through foreign keys: the object's own event table, and every event table with a foreign key to the object's model. A record that names its object some other way, as workflow's ObjectState does with a workflow and a plain integer id, is invisible to that lookup. The app that owns such a record registers a resolver here, so vueda.history can include the record's events without importing that app.
register_state_events
Register a resolver that names an object's workflow state events.
resolver(instance) returns a pghistory.models.Events queryset of the object's state changes, or None when the object has no state events. History publishes the events it returns with relation: "state".
Signature
register_state_events(resolver)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| resolver | yes |
Source
server/vueda/history/sources.py:20
state_events_for
Return the state event querysets that every registered resolver names for instance.
Signature
state_events_for(instance)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| instance | yes |
Source
server/vueda/history/sources.py:31
Source
server/vueda/history/sources.py