2018-01-11 00:58:07 -05:00
|
|
|
from django import forms
|
|
|
|
|
|
|
|
from tinymce import TinyMCE
|
|
|
|
|
2018-01-23 23:00:03 -05:00
|
|
|
from .models import Comment, Post
|
2018-01-11 00:58:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
class CommentForm(forms.ModelForm):
|
|
|
|
reply = forms.CharField(widget=TinyMCE(mce_attrs={'height': 200}))
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Comment
|
|
|
|
fields = ['reply']
|
|
|
|
|
|
|
|
|
|
|
|
class CreatePostForm(forms.ModelForm):
|
|
|
|
question = forms.CharField(widget=TinyMCE(mce_attrs={'height': 200}))
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Post
|
2018-01-14 19:32:00 -05:00
|
|
|
fields = ['title', 'thread', 'question']
|
2018-01-11 00:58:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
class EditPostForm(forms.ModelForm):
|
|
|
|
question = forms.CharField(widget=TinyMCE(mce_attrs={'height': 200}))
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Post
|
|
|
|
fields = ['question']
|