예제 #1
0
파일: search.py 프로젝트: imclab/sparerib
    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
파일: search.py 프로젝트: imclab/sparerib
 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']