forms.py 658 B

123456789101112131415161718
  1. # coding:utf-8
  2. from django import forms
  3. from DjangoUeditor.widgets import UEditorWidget
  4. from DjangoUeditor.forms import UEditorField, UEditorModelForm
  5. from models import Blog
  6. # class TestUEditorForm(forms.Form):
  7. # Name = forms.CharField(label=u'姓名')
  8. # ImagePath = forms.CharField()
  9. # Description = UEditorField(u"描述", initial="abc", width=600, height=800)
  10. # Content = forms.CharField(label=u"内容",
  11. # widget=UEditorWidget(width=1000, height=500, imagePath='aa', filePath='bb', toolbars="full"))
  12. class UEditorTestModelForm(UEditorModelForm):
  13. class Meta:
  14. model = Blog