~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to threadedcomments/forms.py

  • Committer: franku
  • Date: 2016-12-13 18:28:51 UTC
  • mto: This revision was merged to the branch mainline in revision 443.
  • Revision ID: somal@arcor.de-20161213182851-bo5ebf8pdvw5beua
run the script

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
from threadedcomments.models import FreeThreadedComment, ThreadedComment
4
4
from django.utils.translation import ugettext_lazy as _
5
5
 
 
6
 
6
7
class ThreadedCommentForm(forms.ModelForm):
7
8
    """
8
9
    Form which can be used to validate data for a new ThreadedComment.
9
10
    It consists of just two fields: ``comment``, and ``markup``.
10
 
    
 
11
 
11
12
    The ``comment`` field is the only one which is required.
12
13
    """
13
14
 
14
15
    comment = forms.CharField(
15
 
        label = _('comment'),
16
 
        max_length = DEFAULT_MAX_COMMENT_LENGTH,
17
 
        widget = forms.Textarea
 
16
        label=_('comment'),
 
17
        max_length=DEFAULT_MAX_COMMENT_LENGTH,
 
18
        widget=forms.Textarea
18
19
    )
19
20
 
20
21
    class Meta:
21
22
        model = ThreadedComment
22
23
        fields = ('comment', 'markup')
23
24
 
 
25
 
24
26
class FreeThreadedCommentForm(forms.ModelForm):
25
27
    """
26
28
    Form which can be used to validate data for a new FreeThreadedComment.
27
29
    It consists of just a few fields: ``comment``, ``name``, ``website``,
28
30
    ``email``, and ``markup``.
29
 
    
 
31
 
30
32
    The fields ``comment``, and ``name`` are the only ones which are required.
31
33
    """
32
34
 
33
35
    comment = forms.CharField(
34
 
        label = _('comment'),
35
 
        max_length = DEFAULT_MAX_COMMENT_LENGTH,
36
 
        widget = forms.Textarea
 
36
        label=_('comment'),
 
37
        max_length=DEFAULT_MAX_COMMENT_LENGTH,
 
38
        widget=forms.Textarea
37
39
    )
38
40
 
39
41
    class Meta:
40
42
        model = FreeThreadedComment
41
 
        fields = ('comment', 'name', 'website', 'email', 'markup')
 
 
b'\\ No newline at end of file'
 
43
        fields = ('comment', 'name', 'website', 'email', 'markup')