Renders the resource payload.
        :returns: a dict representing the object to be used as payload for a request
481074
def payload(self):
        
        payload = {'type': self.resource_type(), 'attributes': self.attributes}
        if self.id:
            payload['id'] = self.id
        return payload
22
def jsonify_payload(self):
        
        # Assume already json serialized
        if isinstance(self.payload, string_types):
            return self.payload
        return json.dumps(self.payload, cls=StandardJSONEncoder)
827589
def render_to_response(self, context, **response_kwargs):
        
        if self.request.is_ajax():
            data = {
                "content": render_to_string(
                    self.get_template_names(), context, request=self.request)
            }
            return JsonResponse(data)
        if settings.DEBUG:
            return super(PartialAjaxMixin, self).render_to_response(
                context, **response_kwargs)
        raise Http404()
127638
def ToJson(self):
        
        obj = {
            'usage': self.Usage,
            'data': '' if not self.Data else self.Data.hex()
        }
        return obj
1182969
def render(self, data, accepted_media_type=None, renderer_context=None):
        
        self.accepted_media_type = accepted_media_type or ''
        self.renderer_context = renderer_context or {}

        template = loader.get_template(self.template)
        context = self.get_context(data, accepted_media_type, renderer_context)
        ret = template_render(template, context, request=renderer_context['request'])

        # Munge DELETE Response code to allow us to return content
        # (Do this *after* we've rendered the template so that we include
        # the normal deletion response code in the output)
        response = renderer_context['response']
        if response.status_code == status.HTTP_204_NO_CONTENT:
            response.status_code = status.HTTP_200_OK

        return ret
86033
def render(self, renderer=None, **kwargs):
        
        return Markup(get_renderer(current_app, renderer)(**kwargs).visit(
            self))
1018132
def render(self, context):
        
        try:
            args, ctx = self.get_resolved_arguments(context)
            target = args[0]
            if not target:
                return ''
            ctx['content'] = target
        except VariableDoesNotExist:
            return ''

        emitter = context.get('emitter')
        t_name = emitter.get_template_path(target)
        t = get_template(t_name)
        context.dicts.append(ctx)
        response = t.nodelist.render(context)
        context.pop()
        return response
311366
def render(self):
        
        print(self.format_str.format(**self.header), file=sys.stderr)
        print(self.header_format_str.format(**self.header_data), file=sys.stderr)
        for row in self.data:
            print(self.format_str.format(**row))
240421
def emit(self):
        
        # Skip serialize
        if not isinstance(self.response, SerializedHttpResponse):
            return self.response

        self.response.content = self.serialize(self.response.response)
        self.response['Content-type'] = self.media_type
        return self.response
994793
def generate_payload(self):
        
        events = []
        transformation_task = self._get_alias_transformation_properties()
        transformation_task.update(self._get_based_properties())
        events.append(transformation_task)

        for exception in self.exceptions:
            properties = {
                'Reserved.DataModel.Fault.TypeString': exception.__class__.__name__,
                'Reserved.DataModel.Fault.Exception.Message': self.get_exception_message(exception),
                'Reserved.DataModel.Fault.Exception.StackTrace': _get_stack_trace(),
            }
            self.set_custom_properties(properties, 'ActionType', 'Exception')
            self.set_custom_properties(properties, 'Version', VERSION)
            events.append(properties)

        return events
597004
def render(self, request, context, status=codes.ok, content_type=None,
            args=None, kwargs=None):
        ""

        if isinstance(self.template_name, (list, tuple)):
            template = loader.select_template(self.template_name)
        elif self.template_name:
            template = loader.get_template(self.template_name)
        else:
            template = loader.Template(self.template_string)

        context = RequestContext(request, context)
        content = template.render(context)

        return HttpResponse(content, status=status, content_type=content_type)
988996
def payload(self):
        
        if self._content_type is not None:
            try:
                return self._payload[self._content_type]
            except KeyError:
                raise KeyError("Content-Type not available")
        else:

            if defines.Content_types["text/plain"] in self._payload:
                return self._payload[defines.Content_types["text/plain"]]
            else:
                val = list(self._payload.keys())
                return val[0], self._payload[val[0]]
296934
def render(self, content = None, **settings):
        
        (content, settings) = self.get_setup(content, **settings)
        return self._render(content, **settings)
284708
def render(self, tmpl_name, request_env):
        
        return super(WebApplication, self).render(tmpl_name, request_env)
1032534
def payload(self):
        
        _msg = as_unicode(self.part[1])

        # If not JSON web token assume JSON
        if "cty" in self.headers and self.headers["cty"].lower() != "jwt":
            pass
        else:
            try:
                _msg = json.loads(_msg)
            except ValueError:
                pass

        return _msg
155124
def to_dict(self):
        
        request_context_dict = {}
        if self.request_context:
            request_context_dict = self.request_context.to_dict()

        json_dict = {"httpMethod": self.http_method,
                     "body": self.body if self.body else None,
                     "resource": self.resource,
                     "requestContext": request_context_dict,
                     "queryStringParameters": dict(self.query_string_params) if self.query_string_params else None,
                     "headers": dict(self.headers) if self.headers else None,
                     "pathParameters": dict(self.path_parameters) if self.path_parameters else None,
                     "stageVariables": dict(self.stage_variables) if self.stage_variables else None,
                     "path": self.path,
                     "isBase64Encoded": self.is_base_64_encoded
                     }

        return json_dict
704181
def render(self, request, instance, **kwargs):
        
        if instance.get_item():
            return super(LinkPlugin, self).render(request, instance, **kwargs)
        return ""