django-reversion: Can't use proxy models with django-reversion

Hello!

Currently exception is thrown when one tries to register a proxy model. Advice is to register a parent class.

But django emits post_save signal with a proxy model class as a sender (not a parent class) so _post_save_receiver is omitted and thus a version/revision is lost.

Why exactly we may want to restrict proxy-model registration?

It works for me if I register both parent and proxy-child (assuming that I’ve commented out raise RegistrationError(..)).

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 47 (32 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve just made the docs more explicit for this use case. Thanks for the suggestion!

I have implemented limited support for proxy models in this fork https://github.com/AgDude/django-reversion

Tests are still needed. This is working for my specific use case. I have not tested the admin at all.

If a proxy model is registered, that post_save signal will be attached. Versions are saved with the content type of the concrete model, so history must be retrieved using the concrete model. Both the concrete parent model and the proxy model must be registered with reversion. The proxy model can define a different set of “follows” relationships than the concrete parent model.