feedback/forms.py
author nishanth
Wed, 21 Apr 2010 21:58:16 +0530
changeset 40 89d29b1c42b5
parent 5 9a671f3eb24c
permissions -rw-r--r--
removed un necessary info
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     1
from django import forms
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     2
5
9a671f3eb24c created the add feedback functionality
nishanth
parents: 4
diff changeset
     3
from offline.feedback.models import Feedback
4
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     4
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     5
class FeedbackForm(forms.ModelForm):
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     6
    """ A form to collect the feedback.
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     7
    """
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     8
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
     9
    class Meta:
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
    10
        model = Feedback
5
9a671f3eb24c created the add feedback functionality
nishanth
parents: 4
diff changeset
    11
        exclude = [ 'event', 'day', 'user_ip']
4
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
    12
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
    13
    def clean_comments(self):
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
    14
        comments = self.cleaned_data['comments']
e3b8a3ae3857 added an app called event and created the event model.
nishanth
parents:
diff changeset
    15
        return comments.strip()