def form_valid(self, form): self.object = form.save() files = [serialize(self.object)] data = {'files': files} response = JsonResponse(data) response['Content-Disposition'] = 'inline; filename=files.json' return response
def render_to_response(self, context, **response_kwargs): files = [serialize(p) for p in self.get_queryset()] data = {'files': files} response = JsonResponse(data) response['Content-Disposition'] = 'inline; filename=files.json' return response
def render_to_response(self, context, **response_kwargs): files = [ serialize(p) for p in self.get_queryset() ] data = {'files': files} response = JsonResponse(data) response['Content-Disposition'] = 'inline; filename=files.json' return response