示例#1
0
 def _get_current_database(self):
     "Returns the database that should be used for the current request"
     if 'request' in box and not 'CURRENT_DATABASE_NAME' in box:
         current_db = box['request'].get_host().split('.')[0]
     else:
         current_db = box.get('CURRENT_DATABASE_NAME', 'default')
     return current_db
示例#2
0
文件: db.py 项目: alejo8591/maker
 def _get_current_database(self):
     "Returns the database that should be used for the current request"
     if "request" in box and not "CURRENT_DATABASE_NAME" in box:
         current_db = box["request"].get_host().split(".")[0]
     else:
         current_db = box.get("CURRENT_DATABASE_NAME", "default")
     return current_db