access.py 1.12 KB
Newer Older
1 2
# -*- coding: utf-8 -*-
""" access
3

4 5
    setup the connection to the databases.
    Define constants for the different role
6 7
    
"""
8
DB_MYSQL = 'mysql://GesProd:Prod_CPPM@maretude.in2p3.fr/GesProd'
9 10
MIGRATE = False

11 12
ID_ADMIN, ADMIN, DEF_ADMIN = 1, 'admin', 'administrators, librairians,...'
ID_USER, USER, DEF_USER = 2, 'user', 'liaisons, team leaders,...'
13

14
#-------------------------------------------------------------------------------
15
#
16
# MYSQL database
17
#
18
#-------------------------------------------------------------------------------
19 20 21 22
# try:
#     db = DAL(DB_MYSQL, migrate_enabled=MIGRATE, pool_size=10)
# except:
#     raise HTTP(500, T("Can't access the MySQL database !!!"))
23

24 25 26 27 28
#-------------------------------------------------------------------------------
#
# SQLITE database (test)
#
#-------------------------------------------------------------------------------
29
db = DAL('sqlite://storage.sqlite', migrate_enabled=MIGRATE)
30 31 32 33 34 35 36

#-------------------------------------------------------------------------------
#
# virtual database
#
#-------------------------------------------------------------------------------
virtdb = DAL(None)