djanquiltdb-plugin-pghistory
django-pghistory records model changes in event tables through Postgres triggers. DjanQuiltDB shards a database across schemas and nodes. This library makes the two work together: its track() works like pghistory.track(), and places each generated event model in the same place as the tracked model, so the history of a sharded model stays inside its shard:
# example/models.py
from djanquiltdb.decorators import pghistory, sharded_model
@pghistory.track(exclude=['password'])
@sharded_model()
class User(models.Model):
...
The sharding mode is read from the tracked model, so the mode decorator goes below @track(). For a model that cannot have the decorator, such as a third-party model, set its mode in QUILT_DB['OVERRIDE_SHARDING_MODE'], or use track_sharded, track_mirrored or track_public, which do not read the mode from the model.
The tracking functions can also be imported by name, as in from djanquiltdb.decorators.pghistory import track. The event bases and the queryset are in djanquiltdb.models.pghistory.
Install it through DjanQuiltDB’s extra:
pip install djanquiltdb[pghistory]
Full documentation is at https://djanquiltdb.readthedocs.io/en/latest/plugins/pghistory/index.html.
Development
This package is developed in the DjanQuiltDB repository beside djanquiltdb itself. Tests run through tox against the Postgres containers in the repository’s docker-compose.yml; see DOCKER.md at the repository root:
docker compose run --rm test tox
Requirements
Python 3.14
Django 6.0 or 6.1
PostgreSQL 17 or 18
djanquiltdb 4.2.0 or newer 4.x
django-pghistory 3.9.2 or newer 3.x
Metadata
Release files for djanquiltdb-plugin-pghistory 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djanquiltdb_plugin_pghistory-1.0.0.tar.gz | 61.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djanquiltdb_plugin_pghistory-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.3 kB
Release files / djanquiltdb_plugin_pghistory-1.0.0.tar.gz
| Download URL | djanquiltdb_plugin_pghistory-1.0.0.tar.gz |
|---|---|
| Size | 61.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abb9d355e51a0329bf515eecdb7e3013634d39179bbc771c3e1a7233f2d3f445
|
|
BLAKE2b-256 checksum How to use checksums |
8882eb7954addae3a2fa530d0750877b338d9c49cf895b1ffffa2036bc15b6f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / djanquiltdb_plugin_pghistory-1.0.0-py3-none-any.whl
| Download URL | djanquiltdb_plugin_pghistory-1.0.0-py3-none-any.whl |
|---|---|
| Size | 21.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e9ba07489167b374543bddf4d242b22d11e3e1d44f981cf1624e3e94512a5fb
|
|
BLAKE2b-256 checksum How to use checksums |
5222af9c3875fd33c7bca1842516f312c32aae906dec164b185110a9515b075c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency log