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