本文整理汇总了Python中ckeditor.widgets.CKEditorWidget方法的典型用法代码示例。如果您正苦于以下问题:Python widgets.CKEditorWidget方法的具体用法?Python widgets.CKEditorWidget怎么用?Python widgets.CKEditorWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ckeditor.widgets
的用法示例。
在下文中一共展示了widgets.CKEditorWidget方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: formfield_for_dbfield
# 需要导入模块: from ckeditor import widgets [as 别名]
# 或者: from ckeditor.widgets import CKEditorWidget [as 别名]
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name in ('description', 'pricing'):
return db_field.formfield(widget=CKEditorWidget(
config_name='simple_paragraph',
))
elif db_field.name == 'image':
formfield = super(EventPackageAdmin, self).formfield_for_dbfield(db_field, **kwargs)
widget = ForeignKeyRawIdWidgetWrapper(formfield.widget)
formfield.widget = widget
return formfield
return super(EventPackageAdmin, self).formfield_for_dbfield(
db_field, **kwargs)
示例2: formfield_for_dbfield
# 需要导入模块: from ckeditor import widgets [as 别名]
# 或者: from ckeditor.widgets import CKEditorWidget [as 别名]
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name in ('message'):
return db_field.formfield(widget=CKEditorWidget())
return super(UrlLockAdmin, self).formfield_for_dbfield(db_field, **kwargs)
示例3: __init__
# 需要导入模块: from ckeditor import widgets [as 别名]
# 或者: from ckeditor.widgets import CKEditorWidget [as 别名]
def __init__(self, *args, **kwargs):
super(FlatpageForm, self).__init__(*args, **kwargs)
self.fields['content'].widget = CKEditorWidget()
self.fields['sites'].label = '?????'
示例4: formfield_for_dbfield
# 需要导入模块: from ckeditor import widgets [as 别名]
# 或者: from ckeditor.widgets import CKEditorWidget [as 别名]
def formfield_for_dbfield(self, db_field, **kwargs):
formfield = super(SlideAdmin, self).formfield_for_dbfield(db_field, **kwargs)
if db_field.name == 'object_id':
formfield.widget = GenericRawIdWidget()
if db_field.name in ('headline_ovr', 'text_ovr', 'caption_ovr', 'credit_ovr'):
formfield.widget = CKEditorWidget()
return formfield