Follow users

This commit is contained in:
2018-07-09 08:33:04 +02:00
parent 4cbebb9c5a
commit ba1a660b1a
3 changed files with 41 additions and 0 deletions

View File

@@ -395,3 +395,20 @@ class AuditLog(db.Model):
message = f'Audit: [{ip}] [{user.id}] ' + cls.get_message(log_type, user=user.username)
logger.info(message)
class UserFollow(db.Model):
"""Database model for user follows
"""
#: The ID of the profile that is following the other
follower_id = db.Column(db.Integer(), db.ForeignKey('profiles.id'), primary_key=True)
#: The ID of the profile being followed
followed_id = db.Column(db.Integer(), db.ForeignKey('profiles.id'), primary_key=True)
#: The timestamp when the follow was initiated
initiated_at = db.Column(db.DateTime(), default=datetime.utcnow, nullable=False)
#: The timestamp when the follow was accepted
accepted_at = db.Column(db.DateTime(), nullable=True)