Example #1
0
 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
Example #2
0
 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
Example #3
0
 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
Example #4
0
 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