@register.filter
def follows(from_user, to_user):
    """Returns ``True`` if the first user follows the second, ``False`` otherwise.  Example: {% if user|follows:person %}{% endif %}"""
    try:
        relationship = Relationship.objects.get_relationship(from_user, to_user)
        if relationship and not relationship.is_blocked:
            return True
        else:
            return False
    except __HOLE__:
        return False
dataset/ETHPy150Open nathanborror/django-basic-apps/basic/relationships/templatetags/relationships.py/follows