#NEWLINE# def construct_fields( cls ) : #NEWLINE# #INDENT# only_fields = cls . _meta . only_fields #NEWLINE# reverse_fields = get_reverse_fields ( cls . _meta . model ) #NEWLINE# all_fields = sorted ( ( list ( cls . _meta . model . _meta . fields ) + list ( cls . _meta . model . _meta . local_many_to_many ) ) ) #NEWLINE# all_fields += list ( reverse_fields ) #NEWLINE# already_created_fields = { f . attname for f in field . _meta . local_fields } #NEWLINE# for field in all_fields : #NEWLINE# #INDENT# is_not_in_only = ( only_fields and ( field . name not in only_fields ) ) #NEWLINE# is_already_created = ( field . name in already_created_fields ) #NEWLINE# is_excluded = ( ( field . name in cls . _meta . exclude_fields ) or is_already_created ) #NEWLINE# if ( is_not_in_only or is_excluded ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# converted_field = convert_django_field_with_choices ( field ) #NEWLINE# cls . add_to_class ( field . name , converted_field )