Skip to main content

A Django app allowing the tracking of objects field in the admin site.

Project description

Tracking Fields

https://travis-ci.org/makinacorpus/django-tracking-fields.png https://coveralls.io/repos/makinacorpus/django-tracking-fields/badge.png?branch=master

A Django app allowing the tracking of objects field in the admin site.

Requirements

  • Django 4.2: See older versions for earlier version of Django.

  • Add the middleware to also store the current user:

    MIDDLEWARE = (
        ...
        "tracking_fields.middleware.cuser.CuserMiddleware",
        ...
    )

Quick start

  1. Add “tracking_fields” to your INSTALLED_APPS settings.

  2. Add the tracking_fields.decorators.track decorator to your models with the fields you want to track as parameters:

    @track('test', 'm2m')
    class MyModel(models.Model):
        test = models.BooleanField('Test', default=True)
        m2m = models.ManyToManyField(SubModelTest, null=True)
  3. Your objects are now tracked. See the admin site for the tracking information.

  4. If you want to track who does the changes, please install the django-cuser app.

  5. You can also track fields of related objects:

    class MyModel(models.Model):
        test = models.BooleanField('Test', default=True)
    
    @track('related__test')
    class MyOtherModel(models.Model):
        related = models.ForeignKey(MyModel)
  6. You can run the tests with tox (make sure to have django-cuser installed).

Upgrades from 0.1 or 1.0.1

The change to UUID is a mess to do in a migration. The migrations have thus been squashed. You can either alter your fields by hand and do a fake migration afterward or remove your tracking fields tables and run migrations again:

./manage.py migrate --fake tracking_fields zero
./manage.py migrate tracking_fields

FAQ

AUTHORS

makinacom

LICENSE

  • GPLv3+

Changelog

1.5.2 (2026-03-16)

  • Fix datetime.time serialization

1.5.1 (2026-03-06)

  • Add missing middleware file to release

1.5.0 (2026-03-05)

  • Drop Django support < 4.2

  • Add Django 6.0 support

  • Fix UUID serialization

  • Include cuse middleware inside tracking fields as it is no longer maintained

1.4.0 (2023-06-15)

  • Drop Django < 3.2 support

  • Add Django 4.2 support

  • Do not store M2M managers on the instance as original values.

  • Fix TrackerEventUserFilter performance.

1.3.7 (2022-04-07)

  • Do not tracked deferred related fields.

1.3.6 (2022-03-16)

  • Fix error on admin related to filtering content from deleted user

  • Fix deprecation warnings for Django 5.0.

  • Django 3.2 and 4.0 compatibility

1.3.5 (2022-03-09)

  • Increase max_length of TrackedFieldModification.field from 40 to 250

1.3.4 (2021-11-24)

  • Bulk create TrackedFieldModification

1.3.3 (2021-10-25)

  • Fix tracking of models with uuid ids

1.3.2 (2021-09-01)

  • Fix related event when there is no backward relation.

1.3.1 (2021-02-19)

  • Added get_object_model_verbose_name.

1.3.0 (2021-02-19)

  • Added get_object_model on TrackingEvent to be able to get model class in templates.

  • Fix deprecation warnings for Django 4.0.

  • Drop support for Django 2.0 and 2.1.

1.2.1 (2020-10-20)

  • Deferred fields are not tracked to avoid additional requests.

1.2.0 (2020-05-07)

  • fix ‘str’ object has no attribute ‘name’ #6

  • Django 3.0 compatibility

  • Drop support for Django 1.11

1.1.2 (2019-09-11)

  • added serialization for xworkflow StateWrapper

1.1.1 (2019-01-25)

  • Optimize admin user lookup

1.1.0 (2019-01-24)

  • Compatibility with Django 1.11 to 2.1

  • Compatibility droped for earlier versions

1.0.6

  • Fix unicode error in admin with Python 3.4 and django_cuser

1.0.5

  • Fix MANIFEST

1.0.4

  • Order TrackingEvent by -date

1.0.3

  • Fix MANIFEST

1.0.2

  • Include migrations in MANIFEST

1.0.0

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_tracking_fields-1.5.2.tar.gz (62.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_tracking_fields-1.5.2-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

Details for the file django_tracking_fields-1.5.2.tar.gz.

File metadata

  • Download URL: django_tracking_fields-1.5.2.tar.gz
  • Upload date:
  • Size: 62.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for django_tracking_fields-1.5.2.tar.gz
Algorithm Hash digest
SHA256 5538c1f41a635a8d01e2baf637a36339058cf8fa1c921356b6807c69f524c031
MD5 3c09a730ede3a5c9055226067e042c10
BLAKE2b-256 5732741daa71725dca2d31cd0cdd942b397eae362cfd3fbaf4fdedce575e1186

See more details on using hashes here.

File details

Details for the file django_tracking_fields-1.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tracking_fields-1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7eb2ac4386e9329c376f622df0aef1baf8eb351a18b9034c862451892495261d
MD5 308a01d21ff75cfa57e84c4182141a42
BLAKE2b-256 7c4f006bf5d482b30ef4a3afb9d7389e83f904444becc4b6ff07dc069ecefb10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page