diff --git a/app/models.py b/app/models.py index 749e291..385c164 100644 --- a/app/models.py +++ b/app/models.py @@ -3,10 +3,36 @@ from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() +class AgentBap(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(16)) + + +class AgentGrade(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(16)) + + +class AgentStatus(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(16)) + + +class Company(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(16)) + + class Agent(db.Model): id = db.Column(db.Integer, primary_key=True) firstname = db.Column(db.String(100)) secondname = db.Column(db.String(100)) + company_id = db.Column(db.Integer, db.ForeignKey('company.id')) + grade_id = db.Column(db.Integer, db.ForeignKey('agent_grade.id')) + status_id = db.Column(db.Integer, db.ForeignKey('agent_status.id')) + bap_id = db.Column(db.Integer, db.ForeignKey('agent_bap.id')) + virtual = db.Column(db.Integer) # integer boolean + permanent = db.Column(db.Integer) # integer boolean class Project(db.Model): -- libgit2 0.21.2