def _contribute_fields(self, collection):
        is_primary = collection == self.primary_collection
        coll_name = collection._meta['collection']

        try:
            excluded_fields = list(self.excluded_fields[coll_name])
        except __HOLE__:
            excluded_fields = []
        excluded_fields.append('_id')
        excluded_field_set = set(excluded_fields)

        for field_name in collection._fields_ordered:
            field = collection._fields[field_name]
            db_field_name = field.db_field
            if db_field_name in excluded_field_set:
                continue

            if is_primary and self._is_relationship_field(field):
                # Track relationship fields but don't add them to the set of
                # output fields
                self._relationships[field.db_field] = field.document_type._meta['collection']
            else:
                output_field_name = self._transform_field_name(coll_name, db_field_name)
                if output_field_name:
                    self._output_fields.append(output_field_name)
dataset/ETHPy150Open openelections/openelections-core/openelex/base/bake.py/Roller._contribute_fields