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 among post_save
receiver, although it isn't called when I debug it.
I have Django v1.4.1, reversion v1.6.2.
import reversion; reversion.register(Shop)
at the bottom of themodels.py
file where you defineShop
, and see if that fixes the problem? – Potentate