Exemplo n.º 1
0
    def render_to_response(self, context):
        #Check for a JSON 'Accept' header or a req_json in the request
        req_json = self.req_json

        if (self.request.META.get('HTTP_ACCEPT') == "application/json") or req_json:
            return JSONResponseMixin.render_to_response(self, context)
        else:
            return TemplateResponseMixin.render_to_response(self, context)
Exemplo n.º 2
0
 def render_to_response(self, context):
     #Check for a JSON 'Accept' header
     if self.request.META.get('HTTP_ACCEPT') == "application/json":
         return JSONResponseMixin.render_to_response(self, context)
     else:
         return MeBaseView.render_to_response(self, context)