문제

I'm having trouble saving my model revisions when there are proxy models defined.

class MyModel(models.Model):
    field = model.IntegerField(...)


class MyModelProxy(MyModel):
    class Meta:
        proxy = True


reversion.register(MyModel)

I'm using this proxy model on my views and forms. When I try to save it, it doesn't appear in the table reversion_version. Of course entry for MyModelProxy class is added to appropriate tables. I'm using django-reversion 1.7

도움이 되었습니까?

해결책

I'm the author of django-reversion!

This is a known issue with proxy models, due to a bug in Django's content types framework that was only fixed very recently.

A discussion on the issue can be found here:

https://github.com/etianen/django-reversion/issues/134

Of course, now that the underlying issue with Django has been fixed, pull requests to add proxy model support would be greatly appreciated!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top