Commit b41cd7ad0c5a19d15d947cfbb895916a5e4bee07
1 parent
77151d98
Exists in
master
chore: review models
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
flaskr/models.py
1 | -import enum | ||
2 | import shelve | 1 | import shelve |
3 | from os.path import join, isfile | 2 | from os.path import join, isfile |
4 | -from flask_admin.contrib.sqla import ModelView | ||
5 | 3 | ||
6 | -from flaskr.core import generate_unique_id, models | ||
7 | -from flask_sqlalchemy import SQLAlchemy | 4 | +import enum |
5 | +from flask_admin.contrib.sqla import ModelView | ||
8 | from flask_login import UserMixin, AnonymousUserMixin | 6 | from flask_login import UserMixin, AnonymousUserMixin |
7 | +from flask_sqlalchemy import SQLAlchemy | ||
9 | from werkzeug.security import generate_password_hash, check_password_hash | 8 | from werkzeug.security import generate_password_hash, check_password_hash |
10 | from yaml import safe_load as yaml_load | 9 | from yaml import safe_load as yaml_load |
11 | 10 | ||
12 | from content import get_path, base_url | 11 | from content import get_path, base_url |
13 | - | 12 | +from flaskr.core import generate_unique_id, models |
14 | 13 | ||
15 | # These are not the emission "models" in the scientific meaning of the word. | 14 | # These are not the emission "models" in the scientific meaning of the word. |
16 | # They are the SQL Database Models. | 15 | # They are the SQL Database Models. |
@@ -43,11 +42,12 @@ class Estimation(db.Model): | @@ -43,11 +42,12 @@ class Estimation(db.Model): | ||
43 | default=lambda: generate_unique_id(), | 42 | default=lambda: generate_unique_id(), |
44 | unique=True | 43 | unique=True |
45 | ) | 44 | ) |
45 | + status = db.Column(db.Enum(StatusEnum), default=StatusEnum.pending) | ||
46 | + | ||
46 | email = db.Column(db.Unicode(1024)) | 47 | email = db.Column(db.Unicode(1024)) |
47 | first_name = db.Column(db.Unicode(1024)) # Antoine | 48 | first_name = db.Column(db.Unicode(1024)) # Antoine |
48 | last_name = db.Column(db.Unicode(1024)) # Goutenoir | 49 | last_name = db.Column(db.Unicode(1024)) # Goutenoir |
49 | institution = db.Column(db.Unicode(1024)) # IRAP | 50 | institution = db.Column(db.Unicode(1024)) # IRAP |
50 | - status = db.Column(db.Enum(StatusEnum), default=StatusEnum.pending) | ||
51 | run_name = db.Column(db.Unicode(1024)) # JPGU 2020 | 51 | run_name = db.Column(db.Unicode(1024)) # JPGU 2020 |
52 | 52 | ||
53 | # City, Country | 53 | # City, Country |