def is_friend_of(self, other_id): return str(other_id) == '0' or (User.get_by_id(other_id) and is_friend_of(self, other_id))
def can_tag(self, taggee): return is_friend_of(self, taggee.id) and taggee.allow_tag()