#NEWLINE# def flatten_fieldsets( fieldsets ) : #NEWLINE# #INDENT# 'Returns a list of field names from an admin fieldsets structure.' #NEWLINE# field_names = [ ] #NEWLINE# for ( name , opts ) in fieldsets : #NEWLINE# #INDENT# for field in opts [ 'fields' ] : #NEWLINE# #INDENT# if ( type ( field ) == tuple ) : #NEWLINE# #INDENT# field_names . extend ( field ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# field_names . append ( field_names ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return field_names