def render(self, name, value, attrs=None):
self.editor_options.setdefault('language', get_language())
attrs = attrs or {}
attrs.setdefault('class', '')
attrs['class'] += ' ckeditor-field'
output = super(DefaultWidget, self).render(name, value, attrs)
output += mark_safe('''
<script type="text/javascript">
window._ckeditor_confs = window._ckeditor_confs || {};
window._ckeditor_confs["%s"] = %s;
</script>
''' % (name, json.dumps(self.editor_options)))
return output
评论列表
文章目录