#NEWLINE# def get_versions( order = ( 'application' , 'version_int' ) ) : #NEWLINE# #INDENT# def f( ) : #NEWLINE# #INDENT# apps = amo . APP_USAGE #NEWLINE# versions = dict ( ( ( app . id , [ ] ) for app in apps ) ) #NEWLINE# qs = list ( AppVersion . objects . order_by ( * order ) . filter ( application__in = versions ) . values_list ( 'application' , 'version' ) ) #NEWLINE# for ( app , version ) in qs : #NEWLINE# #INDENT# versions [ app ] . append ( version ) #NEWLINE# #UNINDENT# return ( apps , versions ) #NEWLINE# #UNINDENT# return caching . cached ( f , ( 'getv' + '' . join ( order ) ) )