#NEWLINE# def _contribute_fields( self , collection ) : #NEWLINE# #INDENT# is_primary = ( collection == self . primary_collection ) #NEWLINE# coll_name = collection . _meta [ 'collection' ] #NEWLINE# try : #NEWLINE# #INDENT# excluded_fields = list ( self . excluded_fields [ coll_name ] ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# excluded_fields = [ ] #NEWLINE# #UNINDENT# excluded_fields . append ( '_id' ) #NEWLINE# excluded_field_set = set ( excluded_fields ) #NEWLINE# for field_name in collection . _fields_ordered : #NEWLINE# #INDENT# field = collection . _fields [ collection ] #NEWLINE# db_field_name = field . db_field #NEWLINE# if ( db_field_name in excluded_field_set ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( is_primary and self . _is_relationship_field ( field ) ) : #NEWLINE# #INDENT# self . _relationships [ field . db_field ] = field . document_type . _meta [ 'collection' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# output_field_name = self . _transform_field_name ( coll_name , db_field_name ) #NEWLINE# if output_field_name : #NEWLINE# #INDENT# self . _output_fields . append ( output_field_name )