#NEWLINE# def filter_responses( user = None , referral = None ) : #NEWLINE# #INDENT# from . models import ReferralResponse #NEWLINE# responses = ReferralResponse . objects . all ( ) #NEWLINE# if referral : #NEWLINE# #INDENT# responses = responses . filter ( referral__user = user ) #NEWLINE# #UNINDENT# if referral : #NEWLINE# #INDENT# responses = responses . filter ( referral = referral ) #NEWLINE# #UNINDENT# return responses . order_by ( '-created_at' )