.. _common-problems:

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


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.

.. _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.

See also: `"incompatible version data" -> migrate versions JSON, too ? #859 <https://github.com/etianen/django-reversion/issues/859>`_



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.

Add "incompatible version data" in "common problems"
docs: Add "incompatible version data" in "common problems"

See also: https://github.com/etianen/django-reversion/issues/859