@classmethod
def fetch_object(cls, resolwe, id=None, slug=None):
    """Return resource instance that is uniquely defined by identifier."""
    if id is None and slug is None or id and slug:
        raise ValueError('One and only one of id or slug must be given')
    query = resolwe.get_query_by_resource(cls)
    if id:
        return query.get(id=id)
    return query.get(slug=slug)
