Beispiel #1
0
 def requesting_follower(self):
     from models.follower_following import FollowerFollowing
     if self.private == True:
         requesting_follower = FollowerFollowing.select().where(
             (FollowerFollowing.idol_id == self.id)
             & (FollowerFollowing.approved == False))
         return len(requesting_follower)
     else:
         return 0
def review(user_id):
    user = User.get_or_none(User.id == user_id)

# PEEWEEE AND SQL HAVE DIFFERNT COMMNDS. & and and, lookup later

    requests = FollowerFollowing.select().where(
        FollowerFollowing.idol_id == current_user.id)

    # requests = FollowerFollowing.select().where(
    #     (FollowerFollowing.idol_id == current_user.id) & (FollowerFollowing.approved == False))

    if current_user.id == user.id:
        return render_template("follows/requestreview.html", user=user, requests=requests)
    else:
        return abort(401)
 def following(self):
     from models.follower_following import FollowerFollowing
     return [
         user.fan for user in FollowerFollowing.select().where(
             FollowerFollowing.idol_id == self.id)
     ]