Skip to content

Decoupling the creation of revisions from main application logic #984

@ogenodisho

Description

@ogenodisho

I'm looking into using this library as a solution to my version history problem.

One thing I'm trying to figure out is if there's a way to decouple the creation of revisions from the main application logic.

The docs say that in order for a revision to be created, you have to wrap the .save() calls in your main application logic with reversion.create_revision().

This is simple but it does require changes to my main application logic (both existing and future), so I was wondering if there's a way for this to be decoupled.

For example, would it be possible to set up post-save Django Signals in my application which create the revisions? That way, my main application logic doesn't have to care about creating the revisions - it just saves the model and the revisions are created by the signals in place.

Any help is appreciated.

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