api added
This commit is contained in:
13
models.py
13
models.py
@@ -1,4 +1,7 @@
|
||||
from app import db
|
||||
from flask_bcrypt import Bcrypt
|
||||
|
||||
bcrypt = Bcrypt()
|
||||
|
||||
class Content(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
@@ -7,4 +10,14 @@ class Content(db.Model):
|
||||
player_id = db.Column(db.Integer, db.ForeignKey('player.id'), nullable=True)
|
||||
group_id = db.Column(db.Integer, db.ForeignKey('group.id'), nullable=True)
|
||||
|
||||
class Player(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
username = db.Column(db.String(80), unique=True, nullable=False)
|
||||
hostname = db.Column(db.String(120), unique=True, nullable=False)
|
||||
password = db.Column(db.String(120), nullable=False)
|
||||
quickconnect_password = db.Column(db.String(120), nullable=False)
|
||||
|
||||
def verify_quickconnect_code(self, code):
|
||||
return bcrypt.check_password_hash(self.quickconnect_password, code)
|
||||
|
||||
# other models...
|
||||
Reference in New Issue
Block a user