models.py 651 Bytes
Newer Older
Aymeric Barantal's avatar
Aymeric Barantal committed
1
from django.db import models
2
3
from picampaign.campaign.models import CampaignContact
from picampaign.organization.models import FeedbackCategory
4
from django.utils.translation import ugettext_lazy as _
Aymeric Barantal's avatar
Aymeric Barantal committed
5
6
7
8
9
10
11
12
13


class Feedback(models.Model):
    id = models.AutoField(primary_key=True)
    callee = models.ForeignKey(CampaignContact)
    category = models.ForeignKey(FeedbackCategory)
    comment = models.CharField(max_length=512, blank=True)

    def __unicode__(self):
Aymeric Barantal's avatar
Aymeric Barantal committed
14
        return _('feedback for %(callee contact)s on %(campaign title)s') % \
15
16
            {'callee contact': self.callee.contact,
             'campaign title': self.callee.campaign.title}