Commit 3baf5144ff7968369117dcc89f58c70c763df489
1 parent
c4871987
Exists in
master
Adicionados os valores iniciais da tabela profile no script cli.py.
Showing
1 changed file
with
16 additions
and
0 deletions
Show diff stats
cli.py
| ... | ... | @@ -9,6 +9,9 @@ from pybossa.core import db, create_app |
| 9 | 9 | from pybossa.model.project import Project |
| 10 | 10 | from pybossa.model.user import User |
| 11 | 11 | from pybossa.model.category import Category |
| 12 | +from pybossa.model.profile import Profile | |
| 13 | +from sqlalchemy.dialects.postgresql import array | |
| 14 | +from sqlalchemy import Text | |
| 12 | 15 | |
| 13 | 16 | from alembic.config import Config |
| 14 | 17 | from alembic import command |
| ... | ... | @@ -38,6 +41,19 @@ def db_create(): |
| 38 | 41 | description='Volunteer Sensing projects')) |
| 39 | 42 | db.session.add_all(categories) |
| 40 | 43 | db.session.commit() |
| 44 | + # Minimum set of profiles: Colaborador, Animador e Especialista | |
| 45 | + profiles = [] | |
| 46 | + profiles.append(Profile(name="Colaborador", | |
| 47 | + description='Colaborador geral', | |
| 48 | + access=array(['wikilibras'], type_=Text))) | |
| 49 | + profiles.append(Profile(name="Animador", | |
| 50 | + description='Animador 3D', | |
| 51 | + access=array(['wikilibras', 'corretor_sinais'], type_=Text))) | |
| 52 | + profiles.append(Profile(name="Especialista", | |
| 53 | + description='Especialista em LIBRAS', | |
| 54 | + access=array(['wikilibras', 'validador_sinais'], type_=Text))) | |
| 55 | + db.session.add_all(profiles) | |
| 56 | + db.session.commit() | |
| 41 | 57 | |
| 42 | 58 | def db_rebuild(): |
| 43 | 59 | '''Rebuild the db''' | ... | ... |