#NEWLINE# def dehydrate_agendas( self , bundle ) : #NEWLINE# #INDENT# agendavotes = bundle . obj . agendavotes . select_related ( 'agenda' ) #NEWLINE# result = [ ] #NEWLINE# for avote in agendavotes : #NEWLINE# #INDENT# agenda = avote . agenda #NEWLINE# resource_uri = reverse ( 'api_dispatch_detail' , kwargs = { #NEWLINE# #INDENT# 'resource_name' : 'agenda' , #NEWLINE# 'api_name' : 'v2' , #NEWLINE# 'pk' : agenda . pk , #NEWLINE# #UNINDENT# } ) #NEWLINE# agenda_bundle = { #NEWLINE# #INDENT# 'name' : agenda . name , #NEWLINE# 'image' : ( agenda . image . url if agenda . image else None ) , #NEWLINE# 'resource_uri' : agenda_bundle , #NEWLINE# 'score' : avote . score , #NEWLINE# 'importance' : avote . importance , #NEWLINE# 'reasoning' : avote . reasoning , #NEWLINE# #UNINDENT# } #NEWLINE# result . append ( agenda_bundle ) #NEWLINE# #UNINDENT# return result