def diffsets_with_comments(review, current_pair):
 if (not review):
  return
 diffsets = DiffSet.objects.filter(files__comments__review=review)
 diffsets = diffsets.filter(files__comments__interfilediff__isnull=True)
 diffsets = diffsets.distinct()
 for diffset in diffsets:
  (yield {u'diffset': diffset, u'is_current': ((current_pair[0] == diffset) and (current_pair[1] is None))})

def diffsets_with_comments ( review , current_pair ) : if ( not review ) : return diffsets = DiffSet . objects . filter ( files__comments__review = review ) diffsets = diffsets . filter ( files__comments__interfilediff__isnull = True ) diffsets = diffsets . distinct ( ) for diffset in diffsets : ( yield { u'diffset' : diffset , u'is_current' : ( ( current_pair [ 0 ] == diffset ) and ( current_pair [ 1 ] is None ) ) } )
returns a list of diffsets in the review that contain draft comments .