Exemple #1
0
    def get_object(self, request, *args, **kwargs):
        concept = Concept.get_base_queryset(kwargs).first()
        if not concept:
            raise Http404()

        self.source = concept.parent
        self.updated_since = request.GET.get('updated_since', None)
        self.limit = request.GET.get('limit', None)
        return concept
Exemple #2
0
def concepts_for(expression):
    from core.concepts.models import Concept
    queryset = Concept.objects.none()

    try:
        kwargs = get(resolve(expression), 'kwargs', dict())
        query_params = get_query_params_from_url_string(
            expression)  # parsing query parameters
        kwargs.update(query_params)
        queryset = Concept.get_base_queryset(kwargs)
    except:  # pylint: disable=bare-except
        pass

    return queryset
Exemple #3
0
 def get_queryset(self):
     return Concept.get_base_queryset(self.params)
Exemple #4
0
 def get_queryset(self, distinct_by='updated_at'):  # pylint: disable=arguments-differ
     return Concept.get_base_queryset(self.params, distinct_by)
Exemple #5
0
 def get_queryset(self):
     return Concept.get_base_queryset(self.get_filter_params())