コード例 #1
0
 def process_request(self, request):
     """Starts a new search context."""
     if request.META.get(WATSON_MIDDLEWARE_FLAG, False):
         raise ImproperlyConfigured(
             "SearchContextMiddleware can only be included in MIDDLEWARE_CLASSES once."
         )
     request.META[WATSON_MIDDLEWARE_FLAG] = True
     search_context_manager.start()
コード例 #2
0
 def process_request(self, request):
     """Starts a new search context."""
     request.META[(WATSON_MIDDLEWARE_FLAG, self)] = True
     search_context_manager.start()
コード例 #3
0
ファイル: middleware.py プロジェクト: PaulMilla/copaDB_django
 def process_request(self, request):
     """Starts a new search context."""
     request.META[(WATSON_MIDDLEWARE_FLAG, self)] = True
     search_context_manager.start()
コード例 #4
0
ファイル: middleware.py プロジェクト: orf/django-watson
 def process_request(self, request):
     """Starts a new search context."""
     if request.META.get(WATSON_MIDDLEWARE_FLAG, False):
         raise ImproperlyConfigured("SearchContextMiddleware can only be included in MIDDLEWARE_CLASSES once.")
     request.META[WATSON_MIDDLEWARE_FLAG] = True
     search_context_manager.start()