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

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.0.1
File Size Uploaded Provenance Actions
djanquiltdb_plugin_pghistory-1.0.1.tar.gz 60.2 kB With provenance Details for djanquiltdb_plugin_pghistory-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 80.5 kB

Release files / djanquiltdb_plugin_pghistory-1.0.1.tar.gz

Download URL djanquiltdb_plugin_pghistory-1.0.1.tar.gz
Size 60.2 kB
Tags Source
SHA-256 checksum
How to use checksums
35c3f9eeb5ededc7b7656b506909ab6a681093049555def081256400f5cea9e8
BLAKE2b-256 checksum
How to use checksums
131f8612e2eaec6c3870c968cef3db91aa29f130d05aa36852e8b3a43f04a02b
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 19, 2026.

Transparency log

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

Download URL djanquiltdb_plugin_pghistory-1.0.1-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89982ddcf8c1a49b06d1a14604cda947a1e36b4629d08219a53ed687bb521169
BLAKE2b-256 checksum
How to use checksums
ae75d75c152162cb61d1f0e6492f53409d8eafd4aac38f4681fd4b31cc482367
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 19, 2026.

Transparency log

Security for djanquiltdb-plugin-pghistory 1.0.1

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.0.1.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 19, 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