Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. from tinymce import TinyMCE
  2.  
  3. class TinyMCEWidget(TinyMCE):
  4. def use_required_attribute(self, *args):
  5. return False
  6.  
  7.  
  8. class BlogForm(forms.ModelForm):
  9. title = forms.CharField()
  10. content = forms.CharField(
  11. widget=TinyMCEWidget(
  12. attrs={'required': False, 'cols': 30, 'rows': 10}
  13. )
  14. )
  15. image = forms.ImageField()
  16.  
  17. class Meta:
  18. model = BlogPost
  19. fields = [
  20. 'title',
  21. 'content',
  22. 'image'
  23. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement