Пример #1
0
    def get(self, request, query):
        parsed = parse_query(query)
        if any([f for f in parsed['filters'] if f[0] == 'docket']):
            # they've filtered to a single docket, so default to document aggregation
            new_url = reverse('search-documents-view', kwargs={'query': query})
        else:
            # default to docket aggregation
            new_url = reverse('search-dockets-view', kwargs={'query': query})
        if request.META['QUERY_STRING']:
            new_url += "?" + request.META['QUERY_STRING']

        return Response(status=status.HTTP_302_FOUND, headers={'Location': new_url})
Пример #2
0
    def get(self, request, query):
        parsed = parse_query(query)
        if any([f for f in parsed['filters'] if f[0] == 'docket']):
            # they've filtered to a single docket, so default to document aggregation
            new_url = reverse('search-documents-view', kwargs={'query': query})
        else:
            # default to docket aggregation
            new_url = reverse('search-dockets-view', kwargs={'query': query})
        if request.META['QUERY_STRING']:
            new_url += "?" + request.META['QUERY_STRING']

        return Response(status=status.HTTP_302_FOUND, headers={'Location': new_url})
Пример #3
0
 def set_query(self, query):
     parsed = parse_query(query)
     self.raw_query = query
     self.text_query = parsed['text']
     self.filters = parsed['filters']
Пример #4
0
 def set_query(self, query):
     parsed = parse_query(query)
     self.raw_query = query
     self.text_query = parsed['text']
     self.filters = parsed['filters']