def get_by_id(id):
    sites = _get_sites_config()

    try:
        return Site(sites[id])
    except KeyError:
        raise exceptions.SiteNotFound("Site with id '{}' not found".format(id))
The 'target' parameter is the final field being joined to, 'joins'
dataset/ETHPy150Open niwinz/django-sites/django_sites/base.py/get_by_id--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/sql/query.py/Query.trim_joins