def qobjects(cls_target, oid, foreign_name):
    """
    Get queryset objects based on `cls_target` given the object/id `oid` and
    the `foreign_name` is equal.
    """
    if isinstance(oid, int):
        fetcher = 'id'
    else:
        fetcher = 'in'

    kwargs = {'{0}__{1}'.format(foreign_name, fetcher): oid}
    return cls_target.objects.filter(**kwargs)