File: common-problems.rst

package info (click to toggle)
django-reversion 6.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 888 kB
  • sloc: python: 2,893; makefile: 22; sh: 7; sql: 1
file content (21 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.. _common-problems:

Common problems
===============

Incompatible version data
-------------------------

Django-reversion stores the versions of a model as JSON. If a model changes, the migrations are not applied to the stored JSON data. Therefore it can happen that an old version can no longer be restored. In this case the following error occurs:

.. code:: python

    reversion.errors.RevertError: Could not load <Foo: bar> - incompatible version data.


RegistrationError: class 'myapp.MyModel' has already been registered with Reversion
-----------------------------------------------------------------------------------

This is caused by your ``models.py`` file being imported twice, resulting in ``reversion.register()`` being called twice for the same model.

This problem is almost certainly due to relative import statements in your codebase. Try converting all your relative imports into absolute imports.