I have a model called UserCommunityProfiles Structured as follows
class UserCommunityProfile(models.Model):
owner = models.ForeignKey(
User,
on_delete = models.CASCADE)
(...)
and a model called subscriptions structured :
class subscriptions(models.Model):
subscriber = models.ForeignKey(
User,
on_delete = models.CASCADE, related_name='subscriber'
)
subscribed_to = models.ForeignKey(
User,
on_delete = models.CASCADE, related_name='subscribed_to'
)
and what i am trying to achieve is display the profiles of every user which is not in the query set subscriptions as a subscribed_to and the subscriber is request.user
what i did is in the views i did
subs = subscriptions.objects.filter(subscriber=request.user)
profiles = UserCommunityProfile.objects.exclude(owner=subs)
but i get an error saying Cannot use QuerySet for "subscriptions": Use a QuerySet for "User". what should i do ?