def METHOD_NAME(clist):
    if clist.pk is None:
        return Document.objects.none()
    # in theory, we could use an OR query, but databases seem to have
    # trouble with OR queries and complicated joins so do the OR'ing
    # manually
    doc_ids = set(clist.added_docs.values_list("pk", flat=True))
    for rule in clist.searchrule_set.all():
        doc_ids = doc_ids | set(docs_matching_community_list_rule(rule).values_list("pk", flat=True))
    return Document.objects.filter(pk__in=doc_ids)