Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tinymce import TinyMCE
- class TinyMCEWidget(TinyMCE):
- def use_required_attribute(self, *args):
- return False
- class BlogForm(forms.ModelForm):
- title = forms.CharField()
- content = forms.CharField(
- widget=TinyMCEWidget(
- attrs={'required': False, 'cols': 30, 'rows': 10}
- )
- )
- image = forms.ImageField()
- class Meta:
- model = BlogPost
- fields = [
- 'title',
- 'content',
- 'image'
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement