[Django]-Modification date from django-reversion

3👍

This is relatively straightforward using get_for_object_reference:

from reversion.revisions import default_revision_manager
item = MyModel.objects.get(some_criteria=True)
last_edit = default_revision_manager.get_for_object_reference(
        item.__class__,
        item.pk,
    ).first()

last_editor = last_edit.revision.user
date_edited = last_edit.revision.date_created

Leave a comment