Django-pghistory

Latest version: v3.2.0

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

Scan your dependencies

Page 2 of 6

2.8.0

Feature

- Added Python 3.11, Django 4.2, and Psycopg 3 support [Wesley Kendall, 647cdad]

Adds Python 3.11, Django 4.2, and Psycopg 3 support along with tests for multiple Postgres versions.
Drops support for Django 2.2.

2.7.0

Feature

- Refactory ``Snapshot`` class and add ``Changed`` condition for better extensibility. [Kevin Ramirez, 0be9242]

Users can more easily inherit ``pghistory.Snapshot`` and use the ``pghistory.Changed``
condition for conditional snapshots.
- Add ``BeforeUpdateOrDelete`` tracker [Kevin Ramirez, af01e87]

Adds a barebones ``BeforeUpdateOrDelete`` tracker for snapshotting OLD rows during an update or delete.

Trivial

- Fix auto-doc formatting [madtools, de3ddf4]

2.6.0

Bug

- Fix documentation example for tracking events. [Zac Miller, acaaadf]
- Fix bug when tracking context data with percent sign. [Adam Johnson, a5380fa]

All context data is properly escaped, fixing an error that happened when
using "%" in any context data. psycopg now escapes all context data,
ensuring there is no SQL injection vector in the future.

Trivial

- Replace usage of ``SET LOCAL`` with ``SELECT set_config`` for better pg stat reporting. [Pierre Ducroquet, ebe2d19]
- Fix ``make lint`` command with new .gitignore changes [Kevin Ramirez, ceafe0a]
- Fix ``PGHISTORY_OBJ_FIELD`` settings name in the docs. [Johan Van de Wauw, 2bfb23d]
- Updated with latest django template, fixing git-tidy deployment issues [Wesley Kendall, 1a6df96]

2.5.1

Not secure
Trivial

- Updated with latest Django template [Wesley Kendall, de8a535]
- A safer way of determining fields when creating the snapshot triggers [Wesley Kendall, 7b368c3]

2.5.0

Not secure
Bug

- Ignore tracking non-concrete fields [Wesley Kendall, e7b0589]

If a field isn't concrete, pghistory no longer tries to track it.
- Require ``django-pgtrigger>=4.5`` [Wesley Kendall, a70e0d3]

Version 4.5 of ``django-pgtrigger`` fixes several bugs related to trigger migrations,
especially as they relate to ``django-pghistory``.

See the migration guide to ``django-pgtrigger`` version 4 at
https://django-pgtrigger.readthedocs.io/en/4.5.3/upgrading.html#version-4. Upgrading
from version 3 to 4 only affects mutli-database setups.

Feature

- Automatically add the "pgh_event_model" attribute to tracked models. [Wesley Kendall, 917c396]

When a model is tracked, a "pgh_event_model" attribute is added to the tracked model to
make it easier to inherit the event model and access it.
- The label argument for ``pghistory.track`` is optional [Wesley Kendall, b6a8c99]

The label argument was previously required. Now it defaults to the name of the tracker.
- Simplify conditions for snapshots of all fields [Wesley Kendall, e9dbc06]

Previously when using ``pghistory.Snapshot``, the condition for the trigger would OR
together each field to verify nothing changed. Now ``OLD.* IS DISTINCT FROM NEW.*``
is used as the condition.
- Restructure documentation and add more tests [Wesley Kendall, 3bc868e]

The documemntation was overhauled for the new features and
admin integration.
- Added reversion capability [Wesley Kendall, c2d8b90]

A ``revert`` method was added to event models for reverting changes.
The method only runs if the event model tracks every field, otherwise
a ``Runtime`` error is thrown.
- Use ProxyField() for defining proxy columns over attributes. [Wesley Kendall, a267478]

When inheriting the ``Events`` model or individual event models,
one can use the ``pghistory.ProxyField`` utility to proxy
relationships from JSON columns into structured fields. For
example, making a foreign key for users that proxies through the
``user`` attribute of context.

Previously this behavior only worked on the deprecated
``AggregateEvent`` model by adding additional fields. Any
fields that are proxied must now use the ``pghistory.ProxyField``
utility.
- Integration with Django admin [Wesley Kendall, a9fea95]

Installing ``pghistory.admin`` to ``settings.INSTALLED_APPS``
will provide the following:

* An "Events" admin page that other admins can use to display events
* Dynamic buttons on tracked models that redirect to a pre-filtered
events admin
* The ability to make admins for specific event models and have them
show up as buttons on their associated tracked model admin pages

The default events admin has configuration parameters that can
be set via settings.
- New event model configuration and new aggregate ``Events`` model. [Wes Kendall, c1120f2]

Event models can be configured with global settings
and with overrides on a per-event-model basis.
Previous arguments to ``pghistory.track``, such as
``obj_fk`` and ``context_fk`` have been deprecated
in place of ``obj_field`` and ``context_field``.
These new fields, along with their associated settings,
use ``pghistory.Field`` configuration instances.

Along with this, the ``AggregateEvent`` model has been deprecated
in favor of the ``Events`` proxy model. The new
``Events`` model has similar fields and operates the same way, and
it also has other methods for filtering aggregate events.

Trivial

- Rename "tracking" module to "runtime" module. [Wesley Kendall, 43645ea]

2.4.2

Not secure
Trivial

- Update with the latest Python template [Wesley Kendall, ef2fb6e]

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.