Refactored versioning.py (and associated templates) to improve readability and testability.

Takes inspiration from, but does not use, django-reversion-compare. We do a lot of RIGS-specific stuff that requires a lot of hacking to get working nicely with django-reversion-compare. The main example of this is event-item “many-to-one” fields. The performance difference of my code compared to django-reversion-compare was found to be negligible.
This commit is contained in:
David Taylor
2017-06-21 00:50:09 +01:00
parent 3fa9191150
commit 22c520e841
5 changed files with 221 additions and 259 deletions

View File

@@ -33,13 +33,13 @@
{% endif %}
<p>
<small>
{% if version.old == None %}
{% if version.changes.old == None %}
Created
{% else %}
Changed {% include 'RIGS/version_changes.html' %} in
{% endif %}
{% include 'RIGS/object_button.html' with object=version.new %}
{% include 'RIGS/object_button.html' with object=version.changes.new %}
{% if version.revision.comment %}
({{ version.revision.comment }})
{% endif %}