A Django app allowing the tracking of objects field in the admin site.
Project description
Tracking Fields
A Django app allowing the tracking of objects field in the admin site.
Requirements
Django 1.8: See version 0.1 for earlier version of Django.
django-cuser: Only if you want to track which user made the modifications.
Quick start
Add “tracking_fields” to your INSTALLED_APPS settings.
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)
Your objects are now tracked. See the admin site for the tracking information.
If you want to track who does the changes, please install the django-cuser app.
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)
You can run the tests by doing make test (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
Why does my relationship change create two events ?
Please see https://docs.djangoproject.com/en/1.7/ref/models/relations/#direct-assignment
LICENSE
GPLv3+
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-tracking-fields-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 173d41cfada3ec5a25c5d33f654febc2e4c57bf2aa4e5e170951f27330c21152 |
|
MD5 | 049e7e5395dd49faf7f95f2758d3fb04 |
|
BLAKE2b-256 | 53c70d85fd1f633cef614c6534dd83e1842c4e0e4c5d532a47e259b82afa9bef |