Beispiel #1
0
def questions(request: WSGIRequest, name: str) -> JsonResponse:
    request._cache_update_cache = False  # disable internal cache
    puzzle = get_object_or_404(Puzzle, slug=name)
    form = PuzzleForm(data=request.GET, game=puzzle)
    if not form.is_valid():
        return JsonResponse(form.errors, status=400)
    return JsonResponse(form.json())
Beispiel #2
0
 def run(self, meta, *args, **kwargs):
     # TODO: subclass WSGIRequest so all of the wsgi stuff is actually gone
     request = WSGIRequest(meta)
     request._cache_update_cache = True
     if not self.should_rebuild(request):
         return
     handler = AsyncHandler()
     response = handler(request)
 def run(self, meta, *args, **kwargs):
     # TODO: subclass WSGIRequest so all of the wsgi stuff is actually gone
     request = WSGIRequest(meta)
     request._cache_update_cache = True
     if not self.should_rebuild(request):
         return
     handler = AsyncHandler()
     response = handler(request)