models.py 698 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


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)
okhin's avatar
okhin committed
12
    date = models.DateTimeField(auto_now_add=True)
Aymeric Barantal's avatar
Aymeric Barantal committed
13

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