feedback/models.py
author nishanth
Thu, 15 Apr 2010 18:23:21 +0530
changeset 53 0a4b2c49f718
parent 12 f57b0a7f24d9
child 55 53ff84c9192d
permissions -rw-r--r--
changed feedback model since we now take feedback only from logged in users .
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     1
from django.db import models
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     2
from django.contrib.auth.models import User
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     3
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     4
from workshop.reg.models import Event
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     5
1
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
     6
TOPICS_CHOICES = (('1', 'Very relevant'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
     7
                  ('2', 'Relevant'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
     8
                  ('3', 'Somewhat relevant'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
     9
                  ('4', 'Not relevant'))
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    10
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    11
DEPTH_CHOICES = (('1', 'Too detailed'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    12
                 ('2', 'Detailed'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    13
                 ('3', 'Not enough detail'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    14
                 ('4', 'Poor detail'))
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    15
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    16
METHODOLOGY_CHOICES = (('1', 'Extremely effective'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    17
                       ('2', 'Effective'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    18
                       ('3', 'Not very effective'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    19
                       ('4', 'Ineffective'))
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    20
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    21
PACE_CHOICES = (('1', 'Too fast'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    22
                ('2', 'Fast'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    23
                ('3', 'Just right'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    24
                ('4', 'Slow'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    25
                ('5', 'Too slow'))
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    26
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    27
APPLICABILITY_CHOICES = (('1', 'I can use most of it immediately'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    28
                         ('2', 'I can use it somewhat immediately'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    29
                         ('3', 'I cannot use it immediately'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    30
                         ('4', 'I might never use it'))
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    31
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    32
PROBLEMS_CHOICES = (('1', 'Very intersting'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    33
                    ('2', 'Interesting'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    34
                    ('3', 'Somewhat interesting'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    35
                    ('4', 'Not interesting'))
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    36
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    37
EXERCISES_CHOICES = (('1', 'Very instructive'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    38
                     ('2', 'Instructive'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    39
                     ('3', 'Somewhat instructive'),
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    40
                     ('4', 'Not instructive'))
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    41
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    42
class Feedback(models.Model):
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    43
    """ A table to hold the feedbacks.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    44
    """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    45
11
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    46
    event = models.ForeignKey(Event, related_name="%(class)s")
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    47
    day = models.CharField(max_length=1, default='1')
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    48
11
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    49
    topics = models.CharField(max_length=1, choices=TOPICS_CHOICES,
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    50
                              verbose_name="Range of topics covered", blank=True)
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    51
    depth = models.CharField(max_length=1, choices=DEPTH_CHOICES, 
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    52
                             verbose_name="Depth of coverage", blank=True)
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    53
    methodology = models.CharField(max_length=1, choices=METHODOLOGY_CHOICES,
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    54
                                   verbose_name="Effectiveness of methodology", blank=True)
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    55
    pace = models.CharField(max_length=1, choices=PACE_CHOICES,
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    56
                            verbose_name="Pace of coverage", blank=True)
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    57
    applicability = models.CharField(max_length=1, choices=APPLICABILITY_CHOICES, blank=True)
11
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    58
    problems = models.CharField(max_length=1, choices=PROBLEMS_CHOICES,
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    59
                                verbose_name="Choice of problems", blank=True)
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    60
    exercises = models.CharField(max_length=1, choices=EXERCISES_CHOICES,
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    61
                                 verbose_name="Choice of exercises", blank=True)
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    62
    comments = models.TextField(verbose_name="General comments", blank=True)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    63
5
37e4027fba48 submit and list feedback done
nishanth
parents: 2
diff changeset
    64
    def __unicode__(self):
37e4027fba48 submit and list feedback done
nishanth
parents: 2
diff changeset
    65
        
12
f57b0a7f24d9 added closing and opening of feedback.
nishanth
parents: 11
diff changeset
    66
        return unicode(self.event.title)