add login function & change model into t_user
This commit is contained in:
22
models.py
22
models.py
@@ -8,15 +8,21 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||
db = SQLAlchemy(app)
|
||||
|
||||
class Contact(db.Model):
|
||||
|
||||
|
||||
__tablename__ = 'contacts'
|
||||
|
||||
__tablename__ = 't_user'
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(80), nullable=False)
|
||||
surname = db.Column(db.String(100), nullable=True)
|
||||
email = db.Column(db.String(200), nullable=True, unique=True)
|
||||
phone = db.Column(db.String(20), nullable=True, unique=False)
|
||||
name = db.Column(db.String(30), nullable=True)
|
||||
password = db.Column(db.String(30), nullable=True)
|
||||
password2 = db.Column(db.String(30), nullable=True)
|
||||
|
||||
def __repr__(self):
|
||||
return '<Contacts %r>' % self.name
|
||||
|
||||
class User():
|
||||
id = 1
|
||||
username = 'admin'
|
||||
password = 'na'
|
||||
is_active = True
|
||||
is_authenticated = True
|
||||
|
||||
def get_id(id):
|
||||
return 1
|
Reference in New Issue
Block a user