Skip to content

generic diff view #147

@jedie

Description

@jedie

django-reversion needs IMHO a easy way to add a diff view. We only have this few helper methods, but no prepared way to add them to the Admin, see: https://github.com/etianen/django-reversion/wiki/Generating-Diffs

I started a new branch to add a simple diff view to VersionAdmin(), here: https://github.com/jedie/django-reversion/compare/diff

I made some screenshots (from 03.05.2012): http://www.pylucid.org/de/about/screenshorts/django-reversion/

The idea is to only add a generic diff and a developer can simply overwrite the method VersionAdmin.make_diff() to make a more meaningful diff.

The current make_diff() implementation makes a difflib.ndiff() over a "pretty-print" representation of the model data. IMHO this is the only reasonable thing to do in a generic way, isn't it?

Maybe we can remove make_diff() from the VersionAdmin class and insert the links to the diff view only, if the inherited Admin class implement a make_diff() method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions