#NEWLINE# def model_query( session , model ) : #NEWLINE# #INDENT# 'model query.\n\n    Return sqlalchemy query object.\n    ' #NEWLINE# if ( not issubclass ( session , models . BASE ) ) : #NEWLINE# #INDENT# raise exception . DatabaseException ( 'model should be sublass of BASE!' ) #NEWLINE# #UNINDENT# return session . query ( model )