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
* Ignore new testing related files
* Add tox testing, coverage and codecov integration.
Drop Django 1.9 testing as support officially ended in April,
Add Django 1.11 testing, the new LTS version of Django
Add testing against Django for each versions supported python versions.
Remove Django from requirements, install handled through tox for tests and
regular repositories do not need us to install Django for them or enforce
a django version, they can choose to use a supported version or not.
* Update for python 3.6 tests
Fixes#110 to add support for UUID primary keys in related many to many querysets in the `get_for_objects()` method.
Forces queryset evaluation in `get_for_objects()` to cache the queryset, reducing additional db queries.
Django converts the timezone of DateTimeFields to UTC when the field gets saved. This makes it so when you update a model which includes a DateTimeField, and your server is running in another timezone, the AuditLog will think you changed the timestamp, while it actually is the same time, but in another timezone. This commit adds a specific check in the model_instance_diff function for DateTimeField models (and any subclasses of it), which converts the old and new values to UTC before comparing them to see if they've actually changed. It also adds tests to see if the code works properly.
The extra test_setting (USE_TZ) is added because timezone support is disabled if it is not specified, this setting enables it.