#NEWLINE# def get_formfield_labels( self ) : #NEWLINE# #INDENT# '\n            A dictionary of field uuid to field label. We use the label of the\n            field that was used by the most recent submission. Note that this\n            means only fields that have been submitted will show up here.\n            ' #NEWLINE# uuids = FormValue . objects . filter ( submission__in = self ) . values ( 'field_ident' ) . distinct ( ) . order_by ( 'field_node__path' ) . values_list ( 'field_ident' , flat = True ) #NEWLINE# ret = OrderedDict ( [ ( 'created_at' , ugettext ( 'Created at' ) ) ] ) #NEWLINE# for field_uuid in uuids : #NEWLINE# #INDENT# latest_value = FormValue . objects . filter ( field_ident = field_uuid ) . order_by ( '-submission__created_at' , '-pk' ) . select_related ( 'field_node' ) [ 0 ] #NEWLINE# ret [ field_uuid ] = latest_value . get_label ( ) #NEWLINE# #UNINDENT# return ret