def formfield(self, **kwargs): defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)} defaults.update(kwargs) if defaults['widget'] == admin_widgets.AdminTextareaWidget: defaults['widget'] = AdminUEditorWidget( attrs=self.ueditor_settings) return super(UEditorField, self).formfield(**defaults)
def formfield(self, **kwargs): defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)} defaults.update(kwargs) if defaults['widget'] == admin_widgets.AdminTextareaWidget: defaults['widget'] = AdminUEditorWidget( attrs=self.ueditor_settings) return super(UEditorField, self).formfield(**defaults) #以下支持south try: from south.modelsinspector import add_introspection_rules add_introspection_rules([], ["^DjangoUeditor\.models\.UEditorField"]) except: pass