#NEWLINE# @ classmethod #NEWLINE# def transform_row_dataset( self , datarow ) : #NEWLINE# #INDENT# 'transforms the supplied row and evaluates columns of different types\n\n        returns the dict where columns which FKs or Data has been updated with\n        real instances\n        ' #NEWLINE# constructor_data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# m2ms = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( fieldname , data ) in datarow . items ( ) : #NEWLINE# #INDENT# if ( fieldname in self . column_description ) : #NEWLINE# #INDENT# desc = self . column_description [ fieldname ] #NEWLINE# if desc [ 'exclude' ] : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( desc [ 'fk' ] or desc [ 'o2o' ] ) : #NEWLINE# #INDENT# instance = self . get_object ( desc , data ) #NEWLINE# if desc [ 'assign_by_id' ] : #NEWLINE# #INDENT# fieldname += '_id' #NEWLINE# #UNINDENT# constructor_data [ fieldname ] = instance #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if desc [ 'm2m' ] : #NEWLINE# #INDENT# if ( data is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# parts = data . split ( desc [ 'delimiter' ] ) #NEWLINE# objects = [ ] #NEWLINE# for part in parts : #NEWLINE# #INDENT# element = self . get_object ( desc , part ) #NEWLINE# if ( element is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# objects . append ( element ) #NEWLINE# #UNINDENT# m2ms [ fieldname ] = objects #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# constructor_data [ fieldname ] = data #NEWLINE# #UNINDENT# #UNINDENT# return ( parts , m2ms )