def filter(cls, *args, **kwargs): type_name = cls.__get_elastic_type_name__() from elasticosm.models.queryset import Query, QuerySet query = Query.from_query_args(kwargs) query.elastic_type = type_name qs = QuerySet(query=query) return qs
def get(type_name, query_args): from elasticosm.models.queryset import Query, QuerySet query = Query.from_query_args(query_args) if type_name is not None: query.elastic_type = type_name return QuerySet(query=query)
def search(cls, search_term, **kwargs): type_name = cls.__get_elastic_type_name__() from elasticosm.models.queryset import Query, QuerySet query_args = kwargs query_args['search_term'] = search_term query = Query.from_query_args(query_args) query.elastic_type = type_name qs = QuerySet(query=query) return qs