#NEWLINE# def transfield_changed( field , initial , data ) : #NEWLINE# #INDENT# "\n    For forms, compares initial data against cleaned_data for TransFields.\n    Returns True if data is the same. Returns False if data is different.\n\n    Arguments:\n    field -- name of the form field as-is.\n    initial -- data in the form of {'description_en-us': 'x',\n                                    'description_en-br': 'y'}\n    data -- cleaned data in the form of {'description': {'init': '',\n                                                         'en-us': 'x',\n                                                         'en-br': 'y'}\n    " #NEWLINE# initial = [ ( k , v . localized_string ) for ( k , v ) in initial . iteritems ( ) if ( ( ( '%s_' % field ) in k ) and ( v is not None ) ) ] #NEWLINE# data = [ ( ( '%s_%s' % ( field , k ) ) , v ) for ( k , v ) in data [ field ] . iteritems ( ) if ( k != 'init' ) ] #NEWLINE# return ( set ( initial ) != set ( data ) )