djangodjango-reversion

Django reversion recovery from a web page


Is it any chance to implement recovery of the deleted model objects by django-reversion from a site web page or it works only from admin panel? I dont wait for ready solution, rather i need to know if it possible or not or maybe some advice where i need to dig to find information about how to do it.

Sorry for the broad question.

Thanks.


Solution

  • Yes, it is possible by fullfiling following code in the view;

    versions = Version.objects.get_for_model(NameofYourmodel).filter(object_id=someid) 
    versions[0].revision.revert()