~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to threadedcomments/forms.py

  • Committer: Holger Rapp
  • Date: 2009-02-20 12:25:18 UTC
  • Revision ID: holgerrapp@gmx.net-20090220122518-feaq34ta973snnct
Imported wikiapp into our repository, because we did some local changes (users must be logged in to edit wiki pages)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from django import forms
2
 
from threadedcomments.models import DEFAULT_MAX_COMMENT_LENGTH
3
 
from threadedcomments.models import ThreadedComment
4
 
from django.utils.translation import ugettext_lazy as _
5
 
 
6
 
 
7
 
class ThreadedCommentForm(forms.ModelForm):
8
 
    """
9
 
    Form which can be used to validate data for a new ThreadedComment.
10
 
    It consists of just two fields: ``comment``, and ``markup``.
11
 
 
12
 
    The ``comment`` field is the only one which is required.
13
 
    """
14
 
 
15
 
    comment = forms.CharField(
16
 
        label=_('comment'),
17
 
        max_length=DEFAULT_MAX_COMMENT_LENGTH,
18
 
        widget=forms.Textarea
19
 
    )
20
 
 
21
 
    class Meta:
22
 
        model = ThreadedComment
23
 
        fields = ('comment', 'markup')