def render(self, name, value, attrs=None, renderer=None): if renderer is None: renderer = get_default_renderer() if value is None: value = "" final_attrs = self.build_attrs(self.attrs, attrs, name=name) self._set_config() external_plugin_resources = [ [force_str(a), force_str(b), force_str(c)] for a, b, c in self.external_plugin_resources ] return mark_safe( renderer.render( "ckeditor/widget.html", { "final_attrs": flatatt(final_attrs), "value": conditional_escape(force_str(value)), "id": final_attrs["id"], "config": json_encode(self.config), "external_plugin_resources": json_encode( external_plugin_resources), }, ) )
def render(self, name, value, attrs=None, renderer=None): if renderer is None: renderer = get_default_renderer() if value is None: value = '' final_attrs = self.build_attrs(self.attrs, attrs, name=name) self._set_config() external_plugin_resources = [[ force_text(a), force_text(b), force_text(c) ] for a, b, c in self.external_plugin_resources] return mark_safe( renderer.render( 'ckeditor/widget.html', { 'final_attrs': flatatt(final_attrs), 'value': conditional_escape(force_text(value)), 'id': final_attrs['id'], 'config': json_encode(self.config), 'external_plugin_resources': json_encode(external_plugin_resources) }))
def render(self, name, value, attrs=None, renderer=None): if renderer is None: renderer = get_default_renderer() if value is None: value = '' return mark_safe(renderer.render('ueditor/widget.html', { 'value': conditional_escape(force_text(value)), 'config': json_encode(self.config), 'name': name, }))
def render(self, name, value, attrs=None, renderer=None): if renderer is None: renderer = get_default_renderer() if value is None: value = '' final_attrs = self.build_attrs(self.attrs, attrs, name=name) return mark_safe(renderer.render('wangeditor/widget.html', { 'final_attrs': flatatt(final_attrs), # flatatt 设置html 的属性, 形式key=value 'value': force_text(value), 'config': json_encode(self.config), 'id': final_attrs['id'], }))
def render(self, name, value, attrs=None, renderer=None): if not renderer: renderer = get_default_renderer() context = self.get_context(name, value, attrs) if value: areaMsg = {0: "province", 1: "city", 2: "district", 3: "county"} areaData = value.split('/') cityPickerMsg = { areaMsg[i]: areaData[i] for i in range(len(areaData)) } context.update({'cityPickerMsg': cityPickerMsg}) return mark_safe(renderer.render('citypicker/citypicker.html', context))
def render(self, value, name, attrs=None, renderer=None): if renderer is None: renderer = get_default_renderer() if value is None: value = "" final_attrs = self.build_attrs(self.attrs, attrs, name=name) return mark_safe( renderer.render( 'widget.html', { 'final_attrs': flatatt(final_attrs), 'value': conditional_escape(force_text(value)), 'id': final_attrs['id'], 'config': self.config, }))
def render(self, name, value, attrs=None, renderer=None): if value is None: value = '' final_attrs = self.build_attrs(self.attrs, attrs, name=name) params = ('simditor/widget.html', { 'final_attrs': flatatt(final_attrs), 'value': conditional_escape(force_text(value)), 'id': final_attrs['id'], 'config': JSON_ENCODE(self.config) }) if renderer is None and IS_NEW_WIDGET: renderer = get_default_renderer() data = renderer.render(*params) if IS_NEW_WIDGET else render_to_string(*params) return mark_safe(data)