def get_projects_with_bugs():
 projects = mysite.search.models.Project.objects.annotate(bug_count=Count('bug')).filter(bug_count__gt=0).order_by(u'display_name')
 return projects

def get_projects_with_bugs ( ) : projects = mysite . search . models . Project . objects . annotate ( bug_count = Count ( 'bug' ) ) . filter ( bug_count__gt = 0 ) . order_by ( u'display_name' ) return projects
return a sorted list of all the projects for which weve indexed bugs .