Initial commit
This commit is contained in:
15
backend/models.py
Normal file
15
backend/models.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from . import db
|
||||
from flask_login import UserMixin
|
||||
from datetime import datetime
|
||||
|
||||
class User(UserMixin, db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
username = db.Column(db.String(80), unique=True, nullable=False)
|
||||
password = db.Column(db.String(200), nullable=False)
|
||||
|
||||
class LoginIP(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
ip = db.Column(db.String(45), unique=True, nullable=False)
|
||||
count = db.Column(db.Integer, default=0, nullable=False)
|
||||
blocked_until = db.Column(db.DateTime, nullable=True)
|
||||
last_attempt = db.Column(db.DateTime, default=datetime.utcnow, nullable=False)
|
||||
Reference in New Issue
Block a user