本文整理汇总了Python中database.database.DatabaseInterface.load_database_plugin方法的典型用法代码示例。如果您正苦于以下问题:Python DatabaseInterface.load_database_plugin方法的具体用法?Python DatabaseInterface.load_database_plugin怎么用?Python DatabaseInterface.load_database_plugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database.database.DatabaseInterface
的用法示例。
在下文中一共展示了DatabaseInterface.load_database_plugin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _initialize_system
# 需要导入模块: from database.database import DatabaseInterface [as 别名]
# 或者: from database.database.DatabaseInterface import load_database_plugin [as 别名]
def _initialize_system():
# Authentication
AuthenticationInterface.remove_all_authentication_methods()
AuthenticationInterface.add_authentication_method(AuthenticationMethodBasic())
# Database
DatabaseInterface.load_database_plugin(DatabaseSqlite("database.db"))
示例2: setUp
# 需要导入模块: from database.database import DatabaseInterface [as 别名]
# 或者: from database.database.DatabaseInterface import load_database_plugin [as 别名]
def setUp(self):
# Authentication
AuthenticationInterface.remove_all_authentication_methods()
AuthenticationInterface.add_authentication_method(AuthenticationMethodBasic())
# Database
DatabaseInterface.load_database_plugin(DatabaseSqlite("database.db"))
DatabaseInterface.create_new_database()
# Data members
self.__admin_user_id = 1
示例3:
# 需要导入模块: from database.database import DatabaseInterface [as 别名]
# 或者: from database.database.DatabaseInterface import load_database_plugin [as 别名]
from authentication.authentication import AuthenticationInterface
from authentication.basic_authentication_method import AuthenticationMethodBasic
from database.database import DatabaseInterface
from plugins.database.sqlite.database import DatabaseSqlite
import rest_api
if __name__ == '__main__':
# Authentication
AuthenticationInterface.remove_all_authentication_methods()
AuthenticationInterface.add_authentication_method(AuthenticationMethodBasic())
# Database
DatabaseInterface.load_database_plugin(DatabaseSqlite("database.db"))
DatabaseInterface.create_new_database()
# Start server
rest_api.app.run(debug=True)