Package: django-reversion-compare
django-reversion-comparedjango-reversion-compareis an extension todjango-reversionthat provides a history compare view to compare two versions of a model which is under reversion.Comparing model versions is not a easy task. Maybe there are different view how this should looks like.
This project will gives you a generic way to see whats has been changed.Many parts are customizable by overwrite methods or subclassing, see above.InstallationJust use:pip install django-reversion-compareSetupAddreversion_comparetoINSTALLED_APPSin your settings.py, e.g.:INSTALLED_APPS = (
    'django...',
    ...
    'reversion', # https://github.com/etianen/django-reversion
    'reversion_compare', # https://github.com/jedie/django-reversion-compare
    ...
)

# Add reversion models to admin interface:
ADD_REVERSION_ADMIN=True
# optional settings:
REVERSION_COMPARE_FOREIGN_OBJECTS_AS_ID=False
REVERSION_COMPARE_IGNORE_NOT_REGISTERED=FalseUsageInherit fromCompareVersionAdmininstead ofVersionAdminto get the comparison feature.admin.py e.g.:from django.contrib import admin
from reversion_compare.admin import CompareVersionAdmin

from my_app.models import ExampleModel

@admin.register(ExampleModel)
class ExampleModelAdmin(CompareVersionAdmin):
    passIf you're using an existing third party app, then you can add patch django-reversion-compare into
its admin class by using thereversion_compare.helpers.patch_admin()method. For example, to add
version control to the built-in User model:from reversion_compare.helpers import patch_admin

patch_admin(User)e.g.: Add django-cms Page model:from cms.models.pagemodel import Page
from reversion_compare.helpers import patch_admin


# Patch django-cms Page Model to add reversion-compare functionality:
patch_admin(Page)CustomizeIt's possible to change the look for every field or for a entire field type.
You must only define a methods to your admin class with this name scheme:"compare_%s" % field_name"compare_%s" % field.get_internal_type()If there is no method with this name scheme, thefallback_compare()method will be used.An example for specifying a compare method for a model field by name:class YourAdmin(CompareVersionAdmin):
    def compare_foo_bar(self, obj_compare):
        """ compare the foo_bar model field """
        return "%r <-> %r" % (obj_compare.value1, obj_compare.value2)and example usingpatch_adminwith custom version admin class:patch_admin(User, AdminClass=YourAdmin)Class Based ViewBeyond the Admin views, you can also create a Class Based View for displaying and comparing version
differences. This is a single class-based-view that either displays the list of versions to select
for an object or displays both the versionsandtheir differences (if the versions to be compared
have been selected). This class can be used just like a normal DetailView:More information about this can be found in DocString of:HistoryCompareDetailViewThemake run-test-servertest project contains a Demo, use the links under:HistoryCompareDetailView Examples:ScreenshotsHere some screenshots of django-reversion-compare:How to select the versions to compare:fromv0.1.0: DateTimeField compare (last update), TextField compare (content) with small changes and a ForeignKey compare (child model instance was added):fromv0.1.0: Same as above, but the are more lines changed in TextField and the ForeignKey relation was removed:Example screenshot fromv0.3.0: a many-to-many field compare (friends, hobbies):In the first line, the m2m object has been changed.line 2: A m2m object was deletedline 3: A m2m object was removed from this entry (but not deleted)line 4: This m2m object has not changedcreate developer environmentWe usemanage_django_project, so you just need to clone the sources and callmanage.pyto start hacking.e.g.:~$ git clone https://github.com/jedie/django-reversion-compare.git
~$ cd django-reversion-compare

# Just call manage.py and the magic happen:
~/django-reversion-compare$ ./manage.py

# start local dev. web server:
~/django-reversion-compare$ ./manage.py run_dev_server

# run tests:
~/django-reversion-compare$ ./manage.py test
# or with coverage
~/django-reversion-compare$ ./manage.py coverage
# or via tox:
~/django-reversion-compare$ ./manage.py tox pBackwards-incompatible changesv0.16.0We usehttps://github.com/jedie/manage_django_projectto manage the dev venv
and we switch tomainbranch.You must reinit your dev setup.v0.12.0Google "diff-match-patch" is now mandatory and not optional.Version compatibilityReversion-Comparedjango-reversionDjangoPython>=v0.16.0v3.0v3.2, v4.1, v4.2v3.9, v3.10, v3.11>=v0.15.0v3.0v2.2, v3.2, v4.0v3.7, v3.8, v3.9>=v0.13.0v3.0v2.2, v3.0, v3.1v3.7, v3.8, v3.9>=v0.10.0v3.0v2.2, v3.0v3.6, v3.7, v3.8, pypy3>=v0.9.0v2.0v2.2, v3.0v3.6, v3.7, v3.8, pypy3>=v0.8.6v2.0v1.11, v2.0v3.5, v3.6, v3.7, pypy3>=v0.8.4v2.0v1.8, v1.11, v2.0v3.5, v3.6, pypy3>=v0.8.3v2.0v1.8, v1.11v3.5, v3.6, pypy3v0.8.xv2.0v1.8, v1.10, v1.11v2.7, v3.4, v3.5, v3.6 (only with Django 1.11)>=v0.7.2v2.0v1.8, v1.9, v1.10v2.7, v3.4, v3.5v0.7.xv2.0v1.8, v1.9v2.7, v3.4, v3.5v0.6.xv1.9, v1.10v1.8, v1.9v2.7, v3.4, v3.5>=v0.5.2v1.9v1.7, v1.8v2.7, v3.4>=v0.4v1.8v1.7v2.7, v3.4<v0.4v1.6v1.4v2.7These are the unittests variants. See also:/pyproject.tomlMaybe other versions are compatible, too.Changelogdevcompare v0.17.0...mainTBCv0.16.2 - 08.05.2023compare v0.16.2...v0.17.0Remove Django 4.1 tests and add 5.0Remove Python 3.9 from test matrix (because Django 5.0 doesn't support it)Usepretty_reprfromrichinCompareObjectModernize CSS styles and support dark themeAddJSONFieldtoVariantModeltest modelv0.16.2 - 08.05.2023compare v0.16.1...v0.16.2Bugfix compare a registered model that has a relation to a not registered modelFix links in READMEv0.16.1 - 08.04.2023compare v0.16.0...v0.16.1Fix #195 by movingdiff-match-patchformdevto normal dependencies sectionUse newupdate_reqcommand from manage_django_project v0.4.0 to generate requirements txt files for all Django versions for tox.Fix wrong README: v0.16.0 tests runs with Django v3.2, v4.1 and v4.2 (and not v4.0)v0.16.0 - 07.04.2023compare v0.15.0...v0.16.0Refactor dev. project setup and usehttps://github.com/jedie/manage_django_projectRemove support for Django v2.2 -> Test only with Django v3.2, v4.1 and v4.2Remove support for Python v3.7 and 3.9 -> Test only with Python v3.9, v3.10 and v3.11v0.15.0 - 27.01.2022compare v0.14.1...v0.15.0Bugfix model choice fields (e.g.: django-countries fields)Update project and run tests with Django v2.2, v3.2 and v4.0Remove temp file usage in test projectv0.14.1 - 19.07.2021compare v0.14.0...v0.14.1Enable Diff-Match-Patch "checklines" mode for better diffsSpeed up Revision/Version adminv0.14.0 - 24.02.2021compare v0.13.1...v0.14.0Add work-a-round fordjango-reversion #859 incompatible version databy fallback to a ndiff JSON comparepull #149Fix translationsv0.13.1 - 04.02.2021compare v0.13.0...v0.13.1Multiline diff formatting improvementscontributed by dbaderFix django.conf.urls.url() is deprecatedcontributed by GeyseRAdd demo links toHistoryCompareDetailViewin test projectupdate github actionsv0.13.0 - 23.12.2020compare v0.12.2...v0.13.0Support Django v3.1Stop running test with Python 3.6 and pypy3Activate django-debug-toolbar in test projectcode style (e.g.: f-strings) and remove some warnings in test projectsome project setup updates (e.g.: fix Python and Django version restrictions)v0.12.2 - 24.03.2020compare v0.12.1...v0.12.2Added revert button on compare view, contributed by jjarthurv0.12.1 - 20.03.2020compare v0.12.0...v0.12.1Bugfix: Django 3.0 compatibility by change project dependencies, contributed by maxocubTest project used a "auto login test user" middlewareTest project rename django admin title and brandingv0.12.0 - 12.03.2020compare v0.11.0...v0.12.0google-diff-match-patchis now mandatory!Diff html code are now unified to<pre class="highlight">...</pre>Bugfixmake run-test-serverSwitch between Google "diff-match-patch" anddifflib.ndiff()by size: ndiff makes more human readable diffs with small values.v0.11.0 - 12.03.2020compare v0.10.0...v0.11.0CHANGE output of diff generated with "diff-match-patch":cleanup html by implement a own html pretty function instead ofdiff_match_patch.diff_prettyHtmlusageThe html is now simmilar to the difflib usage output and doesn't contain inline stylesAdd "diff-match-patch" as optional dependencies in poetry configBugfix Django requirementscode cleanup and update testsv0.10.0 - 19.02.2020compare v0.9.1...v0.10.0less restricted dependency specification see:issues #120run tests with latest django-reversion version (currently v3.x)v0.9.1 - 16.02.2020compare v0.9.0...v0.9.1Modernize project setup and use poetryApply pyupgrade and fix/update some f-stringsUpdate test projectv0.9.0 - 19.01.2020compare v0.8.7...v0.9.0Test with Python 3.8 and Django 3.0, too.Run tests via github actions, too.Remove support for Python 3.5 and Django v1.11actually check if model is registered #115contributed by willtho89Remove python2 compatibility decorators #113contributed by jeremy-engelShow username and full name from custom user model #112contributed by berekukFix django-suit NoneType is not iterable #111contributed by creativequalityconvert old format to f-strings via flyntCode style:sort imports with isortapply autopep8lint code in CI with flake8, isort and flyntv0.8.7 - 06.01.2020compare v0.8.6...v0.8.7Add new optional settingsREVERSION_COMPARE_IGNORE_NOT_REGISTERED, see:issues #103reformat code with 'black'some code cleanupv0.8.6 - 04.01.2019compare v0.8.5...v0.8.6Bugfix:Use ".pk" instead of ".id" when referring to related object.contributed byPeter LisákRun tests: Skip Django v1.8 and add Python v3.7v0.8.5 - 13.09.2018compare v0.8.4...v0.8.5speed up delete checkingcontributed byLegoStormtrooprv0.8.4 - 15.03.2018compare v0.8.3...v0.8.4Add Django 2.0 compatibilitycontributed bysamifahedv0.8.3 - 21.12.2017compare v0.8.2...v0.8.3refactor travis/tox/pytest/coverage stuffTests can be run viapython3 setup.py toxand/orpython3 setup.py testTest also with pypy3 on Travis CI.v0.8.2 - 06.12.2017:Change ForeignKey relation comparecontributed byalarussWork around a type error triggered by taggitcontributed byAthemisminor code changesv0.8.1 - 02.10.2017:Add added polish translationcontributed byw4rri0r3kBugfix "Django>=1.11" in setup.pyv0.8.0 - 17.08.2017:Run tests with Django v1.11 and drop tests with Django v1.9v0.7.5 - 24.04.2017:Using the 'render' function to ensure the execution of context processors properlycontributed byRodrigo Pinheiro Marques de Araújov0.7.4 - 10.04.2017:Bugfix for Python 2:compare unicode instead of bytescontributed byMaksim Iakovlevremove 'Django20Warning'contributed byHugo TácitoAdd 'Finnish' localisationscontributed byOlli-Pekka Puolitaivalv0.7.3 - 08.02.2017:Fix case when model has template field which is ForeignKeycontributed byLagovasv0.7.2 - 20.10.2016:Add Django v1.10 supportv0.7.1 - 29.08.2016:Fix #79: missing import ifADD_REVERSION_ADMIN != Truev0.7.0 - 25.08.2016:support only django-reversion >= 2.0based on a contribution bymshannon1123remove internalreversion_apiUse toxv0.6.3 - 14.06.2016:Remove unused and deprecated patterscontributed bycodingjoeFix django 1.10 warning #66contributed bypypeteyv0.6.2 - 27.04.2016:Added choices field representation #63contributed byamurekiCheck if related model has an integer as pk for ManyToMany fields. #64contributed bylogaritmiskv0.6.1 - 16.02.2016:pull #61: Fix error when ManyToMany relations didn't exist contributed byDiederik van der Boorv0.6.0 - 03.02.2016:Added Dutch translation contributed bySae XAdd support for Django 1.9Nicer boolean compare:#57Fix#58 compare followed reverse foreign relation fields that are on a non-abstract parent classcontributed by LegoStormtrooprv0.5.6 - 23.09.2015:NEW: Class-Based-View to create non-admin views and greek translation contributed bySerafeim Papastefanos.v0.5.5 - 24.07.2015:UnboundLocalError ('version') when creating deleted list in get_many_to_something()#41v0.5.4 - 22.07.2015:One to one field custom related name fix#42(contributed by frwickst and aemdy)v0.5.3 - 13.07.2015:Update admin.py to avoid RemovedInDjango19Warning (contributed by luzfcb)v0.5.2 - 14.04.2015:contributed by Samuel Spencer:Added Django 1.8 support:pull #35list of changes for reverse fields incorrectly includes a "deletion" for the item that was added in:issues #34v0.5.1 - 28.02.2015:activate previous/next links and add unitests for themv0.5.0 - 27.02.2015:refactory unittests, test with Django v1.7 and Python 2.7 & 3.4v0.4.0 - 02.02.2015:Updates for django 1.7 supportAddsettings.ADD_REVERSION_ADMINv0.3.5 - 03.01.2013:Remove date from version string.issues 9v0.3.4 - 20.06.2012:Use VersionAdmin.revision_manager rather than default_revision_manager, contributed by Mark Lavin - see:pull request 7Use logging for all debug prints, contributed by Bojan Mihelac - see:pull request 8v0.3.3 - 11.06.2012:Bugfix "ValueError: zero length field name in format" with Python 2.6issues 5v0.3.2 - 04.06.2012:Bugfix for Python 2.6 in unified_diff(), see:AttributeError: 'module' object has no attribute '_format_range_unified'v0.3.1 - 01.06.2012:Bugfix: force unicode in html diffBugfix in unittestsv0.3.0 - 16.05.2012:Enhanced handling of m2m changes with follow and non-follow relations.v0.2.2 - 15.05.2012:Compare many-to-many in the right way.v0.2.1 - 10.05.2012:Bugfix for models which has no m2m field:https://github.com/jedie/django-reversion-compare/commit/c8e042945a6e78e5540b6ae27666f9b0cfc94880v0.2.0 - 09.05.2012:many-to-many compare works, too.v0.1.0 - 08.05.2012:First releasev0.0.1 - 08.05.2012:collect all compare stuff from old "diff" branchsee also:https://github.com/etianen/django-reversion/issues/147Links| Github          |https://github.com/jedie/django-reversion-compare|
| Python Packages |https://pypi.org/project/django-reversion-compare/|Donationpaypal.me/JensDiemerFlattr This!SendBitcoinsto1823RZ5Md1Q2X5aSXRC5LRPcYdveCiVX6F