2017-05-10 18:41:02 +02:00
|
|
|
from flask import Flask
|
|
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///book.sqlite'
|
|
|
|
#app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root@localhost/book'
|
|
|
|
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
|
|
|
db = SQLAlchemy(app)
|
|
|
|
|
2017-05-11 18:31:59 +02:00
|
|
|
class Contact(db.Model):
|
2020-10-13 13:06:32 +00:00
|
|
|
__tablename__ = 't_user'
|
2017-05-10 18:41:02 +02:00
|
|
|
id = db.Column(db.Integer, primary_key=True)
|
2020-10-13 13:06:32 +00:00
|
|
|
name = db.Column(db.String(30), nullable=True)
|
|
|
|
password = db.Column(db.String(30), nullable=True)
|
|
|
|
password2 = db.Column(db.String(30), nullable=True)
|
2017-05-10 18:41:02 +02:00
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return '<Contacts %r>' % self.name
|
2020-10-13 13:06:32 +00:00
|
|
|
|
|
|
|
class User():
|
|
|
|
id = 1
|
|
|
|
username = 'admin'
|
|
|
|
password = 'na'
|
|
|
|
is_active = True
|
|
|
|
is_authenticated = True
|
|
|
|
|
|
|
|
def get_id(id):
|
2021-02-28 08:21:28 +00:00
|
|
|
return 1
|
|
|
|
|
|
|
|
class Company():
|
|
|
|
name = ''
|
|
|
|
city = ''
|
|
|
|
date = ''
|
|
|
|
|
|
|
|
class Trans():
|
|
|
|
name = ''
|
|
|
|
date = ''
|
|
|
|
number = ''
|
|
|
|
price = ''
|
|
|
|
|
|
|
|
class Inquery():
|
|
|
|
name = ''
|
|
|
|
date = ''
|
|
|
|
subject = ''
|
|
|
|
|