I have a model Follow:
class Follow(BaseModel):
follower = django.db.models.ForeignKey(
'User',
related_name='_follows_we_are_follower'
)
followee = django.db.models.ForeignKey(
'User',
related_name='_follows_we_are_followee'
)
datetime_canceled = django.db.models.DateTimeField(null=True, blank=True)
When I process a user, how can I get all the users he is following? I suppose that I need something like "Give me all the users for which the Follow object exists with datetime_canceledof None, and followerthat is that user, and then for all subsequent users it should be the users who are in the field followee." How to write this in Django?
source
share