# Connecting to database db_hook = db_module.DBModule(options.database, options.username, options.password) # Loading models pv_hook = PV(db_hook) point_hook = Point(db_hook) proposition_hook = Proposition(db_hook) participant_hook = Participant(db_hook) # Building tables pv_hook.create_table() point_hook.create_table() proposition_hook.create_table() participant_hook.create_table() def setup_routes(obj): for kw in dir(obj): attr = getattr(obj, kw) if hasattr(attr, 'route'): if hasattr(attr, 'method'): print('routing ' + str(attr) + ' with ' + attr.route + ', ' + attr.method) bottle.route(attr.route, attr.method)(attr) else: bottle.route(attr.route)(attr) # Loading controllers
exit(1) # Connecting to database db_hook = db_module.DBModule(options.database, options.username, options.password) # Loading models pv_hook = PV(db_hook) point_hook = Point(db_hook) proposition_hook = Proposition(db_hook) participant_hook = Participant(db_hook) # Building tables pv_hook.create_table() point_hook.create_table() proposition_hook.create_table() participant_hook.create_table() def setup_routes(obj): for kw in dir(obj): attr = getattr(obj, kw) if hasattr(attr, 'route'): if hasattr(attr, 'method'): print('routing ' + str(attr) + ' with ' + attr.route + ', ' + attr.method) bottle.route(attr.route, attr.method)(attr) else: bottle.route(attr.route)(attr) # Loading controllers pv_controller = PV_Controller(db_hook) setup_routes(pv_controller)