django-reversion

django-reversion undo feature - recovering multiple objects

别等时光非礼了梦想. 提交于 2019-12-23 17:01:39
问题 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 create revision that holds data about more than one object. Even when I do with reversion.create_revision(): Res.object.all().delete() then I cannot access revision that groups this change. It's splitted in a "one object one revision.models.Version"

How to add django-reversion to an app developed using django and django-rest framework

邮差的信 提交于 2019-12-19 06:32:30
问题 I have an app developed using Django and Django Rest framework. I would like to add the django-reversion feature to my app. I have already tried http://django-reversion.readthedocs.org/en/latest/api.html#low-level-api but I have failed to make specific changes to my app. Below are the modules of the app where I would like to include the Django-reversion to restore objects if they get deleted. How to set the django-reversion configuration for the below modules admin.py:- from django.contrib

How to add django-reversion to an app developed using django and django-rest framework

风格不统一 提交于 2019-12-19 06:31:35
问题 I have an app developed using Django and Django Rest framework. I would like to add the django-reversion feature to my app. I have already tried http://django-reversion.readthedocs.org/en/latest/api.html#low-level-api but I have failed to make specific changes to my app. Below are the modules of the app where I would like to include the Django-reversion to restore objects if they get deleted. How to set the django-reversion configuration for the below modules admin.py:- from django.contrib

Django reversion does not save revisions made in shell

六眼飞鱼酱① 提交于 2019-12-06 21:41:30
问题 I did the initial installation steps and created the initial revisions, but then when I save a model in django shell, the new revision is not created: In [1]: s = Shop.objects.all()[0] In [2]: import reversion In [3]: s.name = 'a' In [4]: s.save() In [5]: s.name = 'b' In [6]: s.save() In [7]: reversion.get_for_object(s) Out[7]: [<Version: <1> "X">] This is the initial revision. When I update the model from a view, a revision is created successfully. What am I missing? The models.py file is: .

Django reversion does not save revisions made in shell

此生再无相见时 提交于 2019-12-05 02:19:25
I did the initial installation steps and created the initial revisions, but then when I save a model in django shell, the new revision is not created: In [1]: s = Shop.objects.all()[0] In [2]: import reversion In [3]: s.name = 'a' In [4]: s.save() In [5]: s.name = 'b' In [6]: s.save() In [7]: reversion.get_for_object(s) Out[7]: [<Version: <1> "X">] This is the initial revision. When I update the model from a view, a revision is created successfully. What am I missing? The models.py file is: ... class Shop(Model): ... import reversion reversion.register(Shop) <EOF> I see a reversion method

How to add django-reversion to an app developed using django and django-rest framework

拟墨画扇 提交于 2019-12-01 05:20:03
I have an app developed using Django and Django Rest framework. I would like to add the django-reversion feature to my app. I have already tried http://django-reversion.readthedocs.org/en/latest/api.html#low-level-api but I have failed to make specific changes to my app. Below are the modules of the app where I would like to include the Django-reversion to restore objects if they get deleted. How to set the django-reversion configuration for the below modules admin.py:- from django.contrib import admin from.models import Category admin.site.register(Category) models.py:- from django.db import