0

I'm creating a Django application with django-activity-stream. I've registered the app inside the project. Unfortunately, the built-in follower/following feature of the app conflicts with my Follow table - I want more granular control than the library allows. Anyone know how to disable the feature or sidestep this issue?

ERRORS:
actstream.Follow.content_type: (fields.E304) Reverse accessor for 'Follow.content_type' clashes with reverse accessor for 'Follow.content_type'.
    HINT: Add or change a related_name argument to the definition for 'Follow.content_type' or 'Follow.content_type'.
actstream.Follow.user: (fields.E304) Reverse accessor for 'Follow.user' clashes with reverse accessor for 'Follow.user'.
    HINT: Add or change a related_name argument to the definition for 'Follow.user' or 'Follow.user'.
content.Follow.content_type: (fields.E304) Reverse accessor for 'Follow.content_type' clashes with reverse accessor for 'Follow.content_type'.
    HINT: Add or change a related_name argument to the definition for 'Follow.content_type' or 'Follow.content_type'.
content.Follow.user: (fields.E304) Reverse accessor for 'Follow.user' clashes with reverse accessor for 'Follow.user'.
    HINT: Add or change a related_name argument to the definition for 'Follow.user' or 'Follow.user'.

Follow Model:

class Follow(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
    object_id = models.PositiveIntegerField()
    content_object = GenericForeignKey()
lgants
  • 3,665
  • 3
  • 22
  • 33

1 Answers1

1

Try adding a related_name to your model fields:

class Follow(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE,
                     related_name='my_follow_user')
    content_type = models.ForeignKey(ContentType,  
                     on_delete=models.CASCADE,
                     related_name='my_follow_content_type')
    object_id = models.PositiveIntegerField()
    content_object = GenericForeignKey()

or something similar.

Django Models ref:

https://docs.djangoproject.com/en/2.0/ref/models/fields/

A. Rose
  • 470
  • 2
  • 7