forked from gergely/calendar-social
Follow users
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user