django-cms / djangocms-versioning

General purpose versioning package for Django CMS 4 and above.
Other
33 stars 29 forks source link

Related name on Version content type #273

Closed marksweb closed 1 year ago

marksweb commented 2 years ago

I've just tried to add django-reversion to a project for some simple version tracking of objects that have no link to the CMS. It's not possible to migrate in this scenario however because the Version content_type field doesn't specify a related name.

 % python manage.py migrate
SystemCheckError: System check identified some issues:

ERRORS:
djangocms_versioning.Version.content_type: (fields.E304) Reverse accessor for 'djangocms_versioning.Version.content_type' clashes with reverse accessor for 'reversion.Version.content_type'.
        HINT: Add or change a related_name argument to the definition for 'djangocms_versioning.Version.content_type' or 'reversion.Version.content_type'.
reversion.Version.content_type: (fields.E304) Reverse accessor for 'reversion.Version.content_type' clashes with reverse accessor for 'djangocms_versioning.Version.content_type'.
        HINT: Add or change a related_name argument to the definition for 'reversion.Version.content_type' or 'djangocms_versioning.Version.content_type'.

Can we add a related name so that other apps can have a model called Version with a FK to content type?

Aiky30 commented 2 years ago

Possible fix: https://github.com/django-cms/djangocms-versioning/pull/241/files