@register.inclusion_tag('editors/includes/files_view.html')
@jinja2.contextfunction
def all_distinct_files(context, version):
 hashes_to_file = {}
 for file_ in version.all_files:
  display_name = force_text(amo.PLATFORMS[file_.platform].name)
  if (file_.hash in hashes_to_file):
   hashes_to_file[file_.hash][1] += (' / ' + display_name)
  else:
   hashes_to_file[file_.hash] = [file_, display_name]
 return new_context(dict(distinct_files=hashes_to_file.values(), amo=context.get('amo'), addon=context.get('addon'), show_diff=context.get('show_diff'), version=version))

@ register . inclusion_tag ( 'editors/includes/files_view.html' ) @ jinja2 . contextfunction def all_distinct_files ( context , version ) : hashes_to_file = { } for file_ in version . all_files : display_name = force_text ( amo . PLATFORMS [ file_ . platform ] . name ) if ( file_ . hash in hashes_to_file ) : hashes_to_file [ file_ . hash ] [ 1 ] += ( ' / ' + display_name ) else : hashes_to_file [ file_ . hash ] = [ file_ , display_name ] return new_context ( dict ( distinct_files = hashes_to_file . values ( ) , amo = context . get ( 'amo' ) , addon = context . get ( 'addon' ) , show_diff = context . get ( 'show_diff' ) , version = version ) )
only display a file once even if its been uploaded for several platforms .