Commit ad3a824d04e3be7b8ef71d9f4102f7fccb9a9246
1 parent
15a2d3f1
Exists in
master
and in
4 other branches
Add more agent fields
Showing
1 changed file
with
26 additions
and
0 deletions
Show diff stats
app/models.py
... | ... | @@ -3,10 +3,36 @@ from flask_sqlalchemy import SQLAlchemy |
3 | 3 | db = SQLAlchemy() |
4 | 4 | |
5 | 5 | |
6 | +class AgentBap(db.Model): | |
7 | + id = db.Column(db.Integer, primary_key=True) | |
8 | + name = db.Column(db.String(16)) | |
9 | + | |
10 | + | |
11 | +class AgentGrade(db.Model): | |
12 | + id = db.Column(db.Integer, primary_key=True) | |
13 | + name = db.Column(db.String(16)) | |
14 | + | |
15 | + | |
16 | +class AgentStatus(db.Model): | |
17 | + id = db.Column(db.Integer, primary_key=True) | |
18 | + name = db.Column(db.String(16)) | |
19 | + | |
20 | + | |
21 | +class Company(db.Model): | |
22 | + id = db.Column(db.Integer, primary_key=True) | |
23 | + name = db.Column(db.String(16)) | |
24 | + | |
25 | + | |
6 | 26 | class Agent(db.Model): |
7 | 27 | id = db.Column(db.Integer, primary_key=True) |
8 | 28 | firstname = db.Column(db.String(100)) |
9 | 29 | secondname = db.Column(db.String(100)) |
30 | + company_id = db.Column(db.Integer, db.ForeignKey('company.id')) | |
31 | + grade_id = db.Column(db.Integer, db.ForeignKey('agent_grade.id')) | |
32 | + status_id = db.Column(db.Integer, db.ForeignKey('agent_status.id')) | |
33 | + bap_id = db.Column(db.Integer, db.ForeignKey('agent_bap.id')) | |
34 | + virtual = db.Column(db.Integer) # integer boolean | |
35 | + permanent = db.Column(db.Integer) # integer boolean | |
10 | 36 | |
11 | 37 | |
12 | 38 | class Project(db.Model): | ... | ... |