Django-pghistory

Latest version: v3.5.1

Safety actively analyzes 701762 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 8

3.4.0

Features

- Make context middleware extensible by [wesleykendall](https://github.com/wesleykendall) in [#141](https://github.com/Opus10/django-pghistory/pull/141).

Inherit `pghistory.context.HistoryMiddleware` and override `get_context` to add additional context data for every request.

- Support offline documentation formats by [wesleykendall](https://github.com/wesleykendall) in [#144](https://github.com/Opus10/django-pghistory/pull/144).

PDF versions of documentation are built via ReadTheDocs.

Fixes

- Check that the execute result is not `None` before trying to access `execute_result.nextset()` by [wesleykendall](https://github.com/wesleykendall) in [#156](https://github.com/Opus10/django-pghistory/pull/156).
- Ensure `pghistory.create_event` works when using denormalized context by [wesleykendall](https://github.com/wesleykendall) in [#154](https://github.com/Opus10/django-pghistory/pull/154).
- More accurate type hints for the public interface by [wesleykendall](https://github.com/wesleykendall) in [#143](https://github.com/Opus10/django-pghistory/pull/143).
- Fix minor docstring issue in `pghistory.create_event_model` by [wesleykendall](https://github.com/wesleykendall) in [#148](https://github.com/Opus10/django-pghistory/pull/148).

Documentation

- Clean up configuration section of docs, ensure all settings are documented by [wesleykendall](https://github.com/wesleykendall) in [#142](https://github.com/Opus10/django-pghistory/pull/142).
- Modify conditional tracking examples by [wesleykendall](https://github.com/wesleykendall) in [#145](https://github.com/Opus10/django-pghistory/pull/145).
- Add section to FAQ on backfilling data by [wesleykendall](https://github.com/wesleykendall) in [#146](https://github.com/Opus10/django-pghistory/pull/146).
- Adjust guide on tracking management commands by [wesleykendall](https://github.com/wesleykendall) in [#150](https://github.com/Opus10/django-pghistory/pull/150).
- Note the Q/A discussions in the FAQ by [wesleykendall](https://github.com/wesleykendall) in [#152](https://github.com/Opus10/django-pghistory/pull/152).

3.3.0

Features

- `PGHISTORY_INSTALL_CONTEXT_FUNC_ON_MIGRATE` setting to configure installation of tracking function after migrations by [wesleykendall](https://github.com/wesleykendall) in [#140](https://github.com/Opus10/django-pghistory/pull/140).
- `PGHISTORY_CREATED_AT_FUNCTION` setting to configure the function for determining the current time in history triggers by [lokhman](https://github.com/lokhman) in [#137](https://github.com/Opus10/django-pghistory/pull/137).
- Add ASGI support by [pablogadhi](https://github.com/pablogadhi) in [#127](https://github.com/Opus10/django-pghistory/pull/127).

Fixes

- Ensure `BigAutoField`s are properly mirrored in history models by [tobiasmcnulty](https://github.com/tobiasmcnulty) in [#134](https://github.com/Opus10/django-pghistory/pull/134).

!!! warning

If you have event models for models with `BigAutoField` primary keys, you will see new migrations to convert `pgh_obj_id` to a bigint.

- Support filtering event models by referenced proxy models by [lokhman](https://github.com/lokhman) in [#135](https://github.com/Opus10/django-pghistory/pull/135).
- Ensure `bytes` representations of SQL are handled by [tobiasmcnulty](https://github.com/tobiasmcnulty) in [#136](https://github.com/Opus10/django-pghistory/pull/136).
- Fix setting default trackers with the `PGHISTORY_DEFAULT_TRACKERS` setting by [SupImDos](https://github.com/SupImDos) in [#133](https://github.com/Opus10/django-pghistory/pull/133).
- Don't install pghistory's context tracking function on non-postgres databases by [pmdevita](https://github.com/pmdevita) in [#132](https://github.com/Opus10/django-pghistory/pull/132).
- Ensure `MiddlewareEvents` doesn't filter out non-middleware events in the admin by [lokhman](https://github.com/lokhman) in [#130](https://github.com/Opus10/django-pghistory/pull/130).
- Support custom primary keys for the aggregate `Events` proxy model by [lokhman](https://github.com/lokhman) in [#128](https://github.com/Opus10/django-pghistory/pull/128).
- Fix type hints for `pghistory.track` by [SebastianDix](https://github.com/SebastianDix) in [#118](https://github.com/SebastianDix)[https://github.com/Opus10/django-pghistory/pull/118].
- Support named arguments in SQL by (foobarna)[https://github.com/foobarna] in (#111)[https://github.com/Opus10/django-pghistory/pull/111].

Changes

- Django 5.1 compatibility, dropped Django 3.2 / Postgres 12 support by [wesleykendall](https://github.com/wesleykendall) in [#139](https://github.com/Opus10/django-pghistory/pull/139).
- Added section in FAQ for handling issues with concrete inheritance by [xaitec](https://github.com/xaitec) in [#138](https://github.com/Opus10/django-pghistory/pull/138).
- Add reference to DjangoCon talk in the docs by [max-muoto](https://github.com/max-muoto) in [#114](https://github.com/Opus10/django-pghistory/pull/114).

3.2.0

Bug

- Fix Empty List being passed into create_event_model [Maxwell Muoto, b89c86d]

Fix Empty List being passed into create_event_model

3.1.1

Trivial

- Fix ReadTheDocs builds. [Wesley Kendall, eda0741]

3.1.0

Feature

- Django 5.0 compatibility [Wesley Kendall, 934ca6d]

Support and test against Django 5 with psycopg2 and psycopg3.

3.0.1

Trivial

- Add upgrading notes around the default related name changing. [Wesley Kendall, c5d8a1f]

Page 2 of 8

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.