本文整理匯總了Python中models.point.Point.create_table方法的典型用法代碼示例。如果您正苦於以下問題:Python Point.create_table方法的具體用法?Python Point.create_table怎麽用?Python Point.create_table使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.point.Point
的用法示例。
在下文中一共展示了Point.create_table方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: print
# 需要導入模塊: from models.point import Point [as 別名]
# 或者: from models.point.Point import create_table [as 別名]
except ImportError:
print('DB Error.')
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)