Skip to main content
DjanQuiltDB

djanquiltdb-plugin-pghistory

PyPI Supported Python versions Supported Django versions Supported PostgreSQL versions CI Documentation BSD-3-Clause licence

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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djanquiltdb-plugin-pghistory 1.1.0
File Size Uploaded Provenance Actions
djanquiltdb_plugin_pghistory-1.1.0.tar.gz 62.9 kB With provenance Details for djanquiltdb_plugin_pghistory-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djanquiltdb-plugin-pghistory 1.1.0
File Interpreter ABI Platform Actions
djanquiltdb_plugin_pghistory-1.1.0-py3-none-any.whl Python 3 none any Details for djanquiltdb_plugin_pghistory-1.1.0-py3-none-any.whl

Total release size: 84.7 kB

Release files / djanquiltdb_plugin_pghistory-1.1.0.tar.gz

Download URL djanquiltdb_plugin_pghistory-1.1.0.tar.gz
Size 62.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b27726b23b318fa29df085a50df9018104bc00f44c01be784b3593bbd3aba2c0
BLAKE2b-256 checksum
How to use checksums
45010eeaf2a3acc0cf6d531c07d66c2be5ed133e6a824d01813a79e67d61a07f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

Release files / djanquiltdb_plugin_pghistory-1.1.0-py3-none-any.whl

Download URL djanquiltdb_plugin_pghistory-1.1.0-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
439ecd42a716fcefa8ce2075bb10591874f89241e11a8fcb3f73018c3bcb8312
BLAKE2b-256 checksum
How to use checksums
5e448be148dfdfe7ebeac8534abcdd325f0f1c8d7e08ef88feb350c79e2f8510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

Security for djanquiltdb-plugin-pghistory 1.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for djanquiltdb_plugin_pghistory-1.1.0.tar.gz

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 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page