(self, filename=None)
return response
Builds and returns a `HttpResponse` containing the exported data

        Arguments:
            filename (str): if not `None`, the filename is attached to the
                `Content-Disposition` header of the response.
Builds and returns a `HttpResponse` containing the exported data
Builds and returns a HttpResponse containing the exported data
def response(self, filename=None):
        """
        Builds and returns a `HttpResponse` containing the exported data

        Arguments:
            filename (str): if not `None`, the filename is attached to the
                `Content-Disposition` header of the response.
        """
        response = HttpResponse(content_type=self.content_type())
        if filename is not None:
            response["Content-Disposition"] = 'attachment; filename="{}"'.format(filename)

        response.write(self.export())
        return response
def response ( self , filename = None ) : response = HttpResponse ( content_type = self . content_type ( ) ) if filename is not None : response [ "Content-Disposition" ] = 'attachment; filename="{}"' . format ( filename ) response . write ( self . export ( ) ) return response