'Return a solr-appropriate query string that restricts
results to only contain results from sr'

@staticmethod
def _get_sr_restriction(sr):

    bq = []
    if ((not sr) or (sr == All) or isinstance(sr, DefaultSR)):
        return None
    elif isinstance(sr, MultiReddit):
        for sr_id in sr.sr_ids:
            bq.append(('sr_id:%s' % sr_id))
    elif isinstance(sr, DomainSR):
        bq = [("site:'%s'" % sr.domain)]
    elif (sr == Friends):
        if ((not c.user_is_loggedin) or (not c.user.friends)):
            return None
        friend_ids = c.user.friends
        friends = [("author_fullname:'%s'" % Account._fullname_from_id36(r2utils.to36(id_))) for id_ in friend_ids]
        bq.extend(friends)
    elif isinstance(sr, AllMinus):
        for sr_id in sr.exclude_sr_ids:
            bq.append(('-sr_id:%s' % sr_id))
    elif (not isinstance(sr, FakeSubreddit)):
        bq = [('sr_id:%s' % sr._id)]
    return '    OR    '.join(bq)
