Questions tagged [django-reversion]

django-reversion is an extension to the Django web framework that provides comprehensive version control facilities.

Features

  • Roll back to any point in a model's history - an unlimited undo facility!
  • Recover deleted models - never lose data again!
  • Admin integration for maximum usability.
  • Group related changes into revisions that can be rolled back in a single transaction.
  • Automatically save a new version whenever your model changes using Django's flexible signalling framework.
  • Automate your revision management with easy-to-use middleware.

django-reversion can be easily added to your existing Django project with an absolute minimum of code changes.

82 questions
3
votes
1 answer

How to store parent pointers and data in a django reversion?

I'm having some trouble with some code for a django-reversion system I have set up. I have a django model ObjectClass that inherits from a non-abstract model _concept. Long story, very unchangeable now. Makes sense in the rest of the context of the…
user764357
3
votes
2 answers

Django - Reversion and South - How to update past revisions while updating a model?

I would like to preserve past revisions of MyModel instances, while updating and migrating MyModel with south. Is it possible to update the past revisions? Is it necessary to update the revisions on all types of changes to the model? What kind of…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
3
votes
1 answer

Get all revisions with django-reversion

I am using django-reversion. How can I print all revisions in every model in a ListView? I've tried class RevisionListView(ListView): model = reversion.revisions.Version template_name = "revision_list.html" and printing the queryset in my…
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
3
votes
1 answer

Modification date from django-reversion

I used to have two date fields to save the date an object is created and modified and two foreign key fields to save who created or last modified the object. Now I'm using django-reversion and I'm able to save all the users who modified the object…
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
3
votes
1 answer

Why should I care about django-revision operation being atomic?

I want to start using django-reversion. It seems the easiest way is to use their middleware. But it gives the following warning: Warning: Due to changes in the Django 1.6 transaction handling, revision data will be saved in a separate database…
JasonTS
  • 2,479
  • 4
  • 32
  • 48
3
votes
2 answers

How to define serialization for custom type used as value for custom Django field

I have made my own custom models.TextField subclass, which takes classes as its values and encodes those values as the CODE attribute of the given class in the database. All of this is so far working, but I want to use Django-reversion, which…
3
votes
2 answers

New revision isn't created when saving model

I use Reversion to control changes in model objects. In documentation I've found this: Whenever you call save() on a model within the scope of a revision, it will be added to that revision Here's my code where I use model's save…
Dmitrii Mikhailov
  • 5,053
  • 7
  • 43
  • 69
3
votes
2 answers

django-reversion undo feature - recovering multiple objects

I'm trying to implement 'undo' feature in django project with django-reversion in a case when user can accidentally modify multiple objects. Using admin panel won't work as one has to revert objects one-by-one. My problem is that I am unable to…
Jakub Głazik
  • 893
  • 9
  • 13
3
votes
1 answer

Capture all fields that have changed in a model

What I'm trying to do is get a record of all the fields that may have changed after a object has changed. I know there are many ways to tell if an object has changed as well as some other django packages like django-revisions, django-reversion, and…
Austin
  • 4,296
  • 6
  • 40
  • 52
2
votes
0 answers

Most efficient way to do a pivot table-like query to summarize user edits in django

I want to show the user the last 10 changes across all of my database objects. I'm using django-reversion to track the history of changes to my model objects. I'm also somewhat duplicating this in a summary view. Where reversion creates a history…
Ed.
  • 4,439
  • 10
  • 60
  • 78
2
votes
0 answers

When using django-reversion, all revisions appear the same

This bug that got weird quickly. In a fairly complex django project, I noticed that it's impossible to revert anything registered with django-reversion. The displayed history of changes is accurate (dates and comments on what was changed match…
zencodism
  • 442
  • 4
  • 9
2
votes
0 answers

Return just changed fields in django models

On my app I am using django-reversion and django-reversion-compare apps extensions to controll object version. When I update object outside admin I would like set_comment() with just updated fields. How can I access to list of updated fields and set…
user3041764
  • 817
  • 10
  • 35
2
votes
1 answer

How to get previous object value after changing its name using django reversion?

In How to add django-reversion to an app developed using django and django-rest framework I have added the below function to get history of objects from django.http import HttpResponse from reversion.models import Version import json def…
Praneeth
  • 902
  • 2
  • 11
  • 25
2
votes
2 answers

Mark as deleted instead of actually deleting in DeleteView

I am deleting objects in different models with DeleteView in Django. The problem is that I don't want the objects to be completely deleted but rather just hidden. First I thought that it made sense to keep my views as they are but instead overriding…
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
2
votes
1 answer

How to restore related objects with django-reversion

How can I restore related objects by django-reversion. I tried the following which does not work... models.py: @reversion.register(follow=['bar_set',]) class Foo(models.Model): def save(self, *args, **kwargs): with…
user3142459
  • 630
  • 5
  • 18