#NEWLINE# def register_model( self , model_cls ) : #NEWLINE# #INDENT# 'Decorator for registering model.' #NEWLINE# if ( not getattr ( model_cls , '_database_' ) ) : #NEWLINE# #INDENT# raise ModelAttributeError ( ( '_database_ missing on %s!' % model_cls . __name__ ) ) #NEWLINE# #UNINDENT# if ( not getattr ( model_cls , '_collection_' ) ) : #NEWLINE# #INDENT# raise ModelAttributeError ( ( '_collection_ missing on %s!' % model_cls . __name__ ) ) #NEWLINE# #UNINDENT# model_cls . _mongo_client_ = self . client #NEWLINE# logging . info ( ( 'Registering Model ' + model_cls . __name__ ) ) #NEWLINE# return model_cls