

@register.simple_tag
def following_count(user):
    following = Following.objects.filter(follower_object_id=user.id, follower_content_type=ContentType.objects.get_for_model(user))
    return following.count()

dataset/ETHPy150Open amarandon/smeuhsocial/apps/microblogging/templatetags/microblogging_tags.py following_count/original