Skip to content

Commit

Permalink
remove twitter ytorg#2
Browse files Browse the repository at this point in the history
  • Loading branch information
lowne committed Oct 21, 2020
1 parent 5c198dd commit d879a42
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash

followers = db.Table('followers',
db.Column('follower_id', db.Integer, db.ForeignKey('user.id')),
db.Column('followed_id', db.Integer, db.ForeignKey('user.id'))
)

channel_association = db.Table('channel_association',
db.Column('channel_id', db.Integer, db.ForeignKey('channel.id')),
db.Column('user_id', db.Integer, db.ForeignKey('user.id'))
Expand Down Expand Up @@ -36,20 +31,9 @@ def set_password(self, password):
def check_password(self, password):
return check_password_hash(self.password_hash, password)

def follow(self, user):
if not self.is_following(user):
self.followed.append(user)

def unfollow(self, user):
if self.is_following(user):
self.followed.remove(user)

def is_following(self, user):
return self.followed.filter(
followers.c.followed_id == user.id).count() > 0

def following_list(self):
return self.followed.all()

# YOUTUBE
def youtube_following_list(self):
Expand Down

0 comments on commit d879a42

Please sign in to comment.