Django: 3.0.6
Below is my attempt to organize tags and tags for admin staff only (django-taggit is used).
from taggit.managers import TaggableManager # django-taggit
from taggit.models import TaggedItemBase # django-taggit
class SpecialAdminTaggedPost(TaggedItemBase):
content_object = models.ForeignKey('Post',
on_delete=models.PROTECT,
related_name="admin_tagged_post")
class Post(models.Model):
tags = TaggableManager() # django-taggit
admin_tags = TaggableManager(through=SpecialAdminTaggedPost) # django-taggit.
This gives the following error:
ERRORS:
post.Post.admin_tags: (fields.E304) Reverse accessor for 'Post.admin_tags' clashes with reverse accessor for 'Post.tags'.
HINT: Add or change a related_name argument to the definition for 'Post.admin_tags' or 'Post.tags'.
post.Post.tags: (fields.E304) Reverse accessor for 'Post.tags' clashes with reverse accessor for 'Post.admin_tags'.
HINT: Add or change a related_name argument to the definition for 'Post.tags' or 'Post.admin_tags'.
System check identified 2 issues (0 silenced).
Docs (not sure if it is of any help here): https://django-taggit.readthedocs.io/en/v0.10/custom_tagging.html
How can I cope with this problem?