1
from django import forms
2
from threadedcomments.models import DEFAULT_MAX_COMMENT_LENGTH
3
from threadedcomments.models import FreeThreadedComment, ThreadedComment
4
from django.utils.translation import ugettext_lazy as _
6
class ThreadedCommentForm(forms.ModelForm):
8
Form which can be used to validate data for a new ThreadedComment.
9
It consists of just two fields: ``comment``, and ``markup``.
11
The ``comment`` field is the only one which is required.
14
comment = forms.CharField(
16
max_length = DEFAULT_MAX_COMMENT_LENGTH,
17
widget = forms.Textarea
21
model = ThreadedComment
22
fields = ('comment', 'markup')
24
class FreeThreadedCommentForm(forms.ModelForm):
26
Form which can be used to validate data for a new FreeThreadedComment.
27
It consists of just a few fields: ``comment``, ``name``, ``website``,
28
``email``, and ``markup``.
30
The fields ``comment``, and ``name`` are the only ones which are required.
33
comment = forms.CharField(
35
max_length = DEFAULT_MAX_COMMENT_LENGTH,
36
widget = forms.Textarea
40
model = FreeThreadedComment
41
fields = ('comment', 'name', 'website', 'email', 'markup')
b'\\ No newline at end of file'