I want to undo my changes done in the model. I can undo it 1-level down using django-reversion. how but do I undo my changes multiple times.
For eg:-
I've a model
with reversion.create_revision():
server_obj = Server(url = 1)
server_obj.save()
Now, I update it twice. by the word twice, I mean I called this function twice or say n times.
with reversion.create_revision():
url = bundle.data['url']
server_obj.url = url
How do I undo in n-times down.
Currently, I'm doing like this.
your_model = Server.objects.get(id = id)
version_list = reversion.get_unique_for_object(your_model)
version = version_list[1]
version.revision.revert()
How will I do it???