#NEWLINE# def __init__( self , cls , db_alias ) : #NEWLINE# #INDENT# ' Construct the switch_db context manager\n\n        :param cls: the class to change the registered db\n        :param db_alias: the name of the specific database to use\n        ' #NEWLINE# self . cls = cls #NEWLINE# self . collection = cls . _get_collection ( ) #NEWLINE# self . db_alias = db_alias #NEWLINE# self . ori_db_alias = cls . _meta . get ( 'db_alias' , DEFAULT_CONNECTION_NAME )