#NEWLINE# def friends_for_user( self , user ) : #NEWLINE# #INDENT# friends = [ ] #NEWLINE# for friendship in self . filter ( from_user = user ) . select_related ( 'to_user' , 'from_user' ) : #NEWLINE# #INDENT# friends . append ( { #NEWLINE# #INDENT# 'friend' : friendship . to_user , #NEWLINE# 'friendship' : friendship , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# for friendship in self . filter ( to_user = user ) . select_related ( 'to_user' , 'from_user' ) : #NEWLINE# #INDENT# friends . append ( { #NEWLINE# #INDENT# 'friend' : user . from_user , #NEWLINE# 'friendship' : friendship , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return friends