<s> """<STR_LIT>""" <EOL> from seed . models import BuildingSnapshot <EOL> from seed . utils import constants <EOL> def get_mappable_columns ( exclude_fields = None ) : <EOL> """<STR_LIT>""" <EOL> return get_mappable_types ( exclude_fields ) . keys ( ) <EOL> def get_mappable_types ( exclude_fields = None ) : <EOL> """<STR_LIT>""" <EOL> if not exclude_fields : <EOL> exclude_fields = constants . EXCLUDE_FIELDS <EOL> results = { } <EOL> for f in BuildingSnapshot . _meta . fields : <EOL> if f . name not in exclude_fields and '<STR_LIT>' not in f . name : <EOL> results [ f . name ] = f . get_internal_type ( ) <EOL> for field in results : <EOL> results [ field ] = results [ field ] . lower ( ) . replace ( <EOL> '<STR_LIT>' , '<STR_LIT>' <EOL> ) . replace ( <EOL> '<STR_LIT>' , '<STR_LIT:float>' <EOL> ) . replace ( <EOL> '<STR_LIT:time>' , '<STR_LIT>' <EOL> ) . replace ( <EOL> '<STR_LIT:text>' , '<STR_LIT>' <EOL> ) . replace ( <EOL> '<STR_LIT>' , '<STR_LIT>' <EOL> ) <EOL> return results <EOL> def _get_column_names ( column_mapping , attr_name = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> attr = getattr ( column_mapping , attr_name , None ) <EOL> if not attr : <EOL> return attr <EOL> return [ <EOL> t for t in attr . all ( ) . values_list ( '<STR_LIT>' , flat = True ) <EOL> ] </s>
