Blame view

app/models.py 544 Bytes
76ef4fbe   hitier   Click, Sqlalchemy...
1
2
3
4
5
6
7
8
9
10
from flask_login import UserMixin
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()


class User(UserMixin, db.Model):
    id = db.Column(db.Integer, primary_key=True)  # primary keys are required by SQLAlchemy
    email = db.Column(db.String(100), unique=True)
    name = db.Column(db.String(1000))
18ae7b15   hitier   Add user.login field
11
    login = db.Column(db.String(1000), unique=True)
76ef4fbe   hitier   Click, Sqlalchemy...
12
13
14
    password = db.Column(db.String(100))

    def __repr__(self):
18ae7b15   hitier   Add user.login field
15
        return "i: {}, n: {}, e: {}, l: {}, p: {}".format(self.id, self.name, self.email, self.login, self.password)