models.py 649 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):
14 15 16
        return _('feedback for %(callee contact) on %(campaign title)') % \
            {'callee contact': self.callee.contact,
             'campaign title': self.callee.campaign.title}