A Django app that keeps a log of changes made to an object.
Find a file
Ryan Castner 45760c6316 Fixes #93 - Add 'changes_display_dict' property to 'LogEntry' model to display diff in a more human readable format (#94)
Fixes #93 - Add 'changes_display_dict' property to 'LogEntry' model to display diff in a more human readable format

'changes_display_dict' currently handles fields with choices, long textfields and charfields, datefields, timefields, and datetimefields. Supports `django-multiselectfield` with choices and Postgres's ArrayField with choices.

Textfields and Charfields longer than 140 characters are truncated with an ellipsis appended.
Date, Time and DateTime fields are rendered according to `L10N`, or if turned off fall back on Django settings defaults for DATE_FORMAT, TIME_FORMAT and DATETIME_FORMAT.

A new kwarg was added to 'AuditlogModelRegistry' called 'mapping_fields'. The kwarg allows the user to map the fields in the model to a more human readable or intuitive name. If a field isn't mapped it will default to the `verbose_name` as defined on the model or the Django default `verbose_name`. Partial mapping is supported, all fields do not need to be mapped to use the feature.

* Add django-multiselectfield test dep

* Add psycopg2 test dep

* Add postgres testing database and router

* Add postgres support to travis builds

* Add support for multiple databases. LogEntry saves to same database of the model its associated to

* If any literal evals fail default to None

* Add support for Postgres ArrayField in changes_display_dict

* Revert to old travis image while they are fixing issues with it

* Update docs

* Add full test coverage
2017-09-13 10:57:47 -04:00
docs Fixes #93 - Add 'changes_display_dict' property to 'LogEntry' model to display diff in a more human readable format (#94) 2017-09-13 10:57:47 -04:00
src Fixes #93 - Add 'changes_display_dict' property to 'LogEntry' model to display diff in a more human readable format (#94) 2017-09-13 10:57:47 -04:00
.gitignore Chore -- Update testing (#126) 2017-07-05 09:32:27 -04:00
.travis.yml Fixes #93 - Add 'changes_display_dict' property to 'LogEntry' model to display diff in a more human readable format (#94) 2017-09-13 10:57:47 -04:00
LICENSE Bump year in license 2015-05-15 11:55:45 +02:00
MANIFEST Update manifest after release 2016-12-27 11:22:10 +01:00
README.md Version bump and slight doc changes for 0.4.1 2016-12-27 11:08:12 +01:00
requirements-test.txt Fixes #93 - Add 'changes_display_dict' property to 'LogEntry' model to display diff in a more human readable format (#94) 2017-09-13 10:57:47 -04:00
requirements.txt Fixes #93 - Add 'changes_display_dict' property to 'LogEntry' model to display diff in a more human readable format (#94) 2017-09-13 10:57:47 -04:00
setup.py Add management commands package to setup.py (#130) 2017-07-05 08:50:38 -04:00
tox.ini Chore -- Update testing (#126) 2017-07-05 09:32:27 -04:00

django-auditlog

Build Status Docs

Please remember that this app is still in development. Test this app before deploying it in production environments.

django-auditlog (Auditlog) is a reusable app for Django that makes logging object changes a breeze. Auditlog tries to use as much as Python and Djangos built in functionality to keep the list of dependencies as short as possible. Also, Auditlog aims to be fast and simple to use.

Auditlog is created out of the need for a simple Django app that logs changes to models along with the user who made the changes (later referred to as actor). Existing solutions seemed to offer a type of version control, which was found excessive and expensive in terms of database storage and performance.

The core idea of Auditlog is similar to the log from Djangos admin. Unlike the log from Djangos admin (django.contrib.admin) Auditlog is much more flexible. Also, Auditlog saves a summary of the changes in JSON format, so changes can be tracked easily.

Documentation

The documentation for django-auditlog can be found on http://django-auditlog.readthedocs.org. The source files are available in the docs folder.

License

Auditlog is licensed under the MIT license (see the LICENSE file for details).

Contribute

If you have great ideas for Auditlog, or if you like to improve something, feel free to fork this repository and/or create a pull request. I'm open for suggestions. If you like to discuss something with me (about Auditlog), please open an issue.