feedback/models.py
author nishanth
Tue, 20 Apr 2010 21:15:18 +0530
changeset 18 c66b4904ce5a
parent 3 abfecc652a16
permissions -rw-r--r--
ditchaxed username from start_quiz url
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     1
from django.db import models
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     2
3
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
     3
from offline.event.models import Event
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
     4
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
     5
TOPICS_CHOICES = (('1', 'Very relevant'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
     6
                  ('2', 'Relevant'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
     7
                  ('3', 'Somewhat relevant'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
     8
                  ('4', 'Not relevant'))
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
     9
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    10
DEPTH_CHOICES = (('1', 'Too detailed'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    11
                 ('2', 'Detailed'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    12
                 ('3', 'Not enough detail'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    13
                 ('4', 'Poor detail'))
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    14
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    15
METHODOLOGY_CHOICES = (('1', 'Extremely effective'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    16
                       ('2', 'Effective'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    17
                       ('3', 'Not very effective'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    18
                       ('4', 'Ineffective'))
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    19
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    20
PACE_CHOICES = (('1', 'Too fast'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    21
                ('2', 'Fast'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    22
                ('3', 'Just right'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    23
                ('4', 'Slow'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    24
                ('5', 'Too slow'))
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    25
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    26
APPLICABILITY_CHOICES = (('1', 'I can use most of it immediately'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    27
                         ('2', 'I can use it somewhat immediately'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    28
                         ('3', 'I cannot use it immediately'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    29
                         ('4', 'I might never use it'))
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    30
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    31
PROBLEMS_CHOICES = (('1', 'Very intersting'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    32
                    ('2', 'Interesting'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    33
                    ('3', 'Somewhat interesting'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    34
                    ('4', 'Not interesting'))
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    35
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    36
EXERCISES_CHOICES = (('1', 'Very instructive'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    37
                     ('2', 'Instructive'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    38
                     ('3', 'Somewhat instructive'),
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    39
                     ('4', 'Not instructive'))
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    40
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    41
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    42
class Feedback(models.Model):
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    43
    """ A table to hold the feedbacks.
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    44
    """
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    45
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    46
    event = models.ForeignKey(Event, related_name="%(class)s")
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    47
    day = models.CharField(max_length=1, default='1')
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    48
    user_ip = models.CharField(max_length=15)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    49
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    50
    topics = models.CharField(max_length=1, choices=TOPICS_CHOICES,
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    51
                              verbose_name="Range of topics covered", blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    52
    depth = models.CharField(max_length=1, choices=DEPTH_CHOICES, 
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    53
                             verbose_name="Depth of coverage", blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    54
    methodology = models.CharField(max_length=1, choices=METHODOLOGY_CHOICES,
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    55
                                   verbose_name="Effectiveness of methodology", blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    56
    pace = models.CharField(max_length=1, choices=PACE_CHOICES,
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    57
                            verbose_name="Pace of coverage", blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    58
    applicability = models.CharField(max_length=1, choices=APPLICABILITY_CHOICES, blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    59
    problems = models.CharField(max_length=1, choices=PROBLEMS_CHOICES,
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    60
                                verbose_name="Choice of problems", blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    61
    exercises = models.CharField(max_length=1, choices=EXERCISES_CHOICES,
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    62
                                 verbose_name="Choice of exercises", blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    63
    comments = models.TextField(verbose_name="General comments", blank=True)
abfecc652a16 added feedback model
nishanth
parents: 1
diff changeset
    64