Révision 0b074678
Ajouté par Serghei Mihai (congés, retour 15/05) il y a presque 8 ans
corbo/models.py | ||
---|---|---|
53 | 53 |
|
54 | 54 |
class Broadcast(models.Model): |
55 | 55 |
announce = models.ForeignKey(Announce, verbose_name=_('announce')) |
56 |
time = models.DateTimeField(_('sent time'), auto_now_add=True)
|
|
56 |
deliver_time = models.DateTimeField(_('Deliver time'), null=True)
|
|
57 | 57 |
result = models.TextField(_('result'), blank=True) |
58 | 58 |
|
59 | 59 |
def __unicode__(self): |
60 |
return u'announce {id} sent via {channel} at {time}'.format( |
|
61 |
id=self.announce.id, channel=self.channel, time=self.time) |
|
60 |
if self.deliver_time: |
|
61 |
return u'announce {id} delivered via at {time}'.format( |
|
62 |
id=self.announce.id, time=self.deliver_time) |
|
63 |
return u'announce {id} to deliver'.format(id=self.announce.id) |
|
62 | 64 |
|
63 | 65 |
class Meta: |
64 | 66 |
verbose_name = _('sent') |
65 |
ordering = ('-time',) |
|
67 |
ordering = ('-deliver_time',)
|
|
66 | 68 |
|
67 | 69 |
|
68 | 70 |
class Subscription(models.Model): |
Formats disponibles : Unified diff
rename broadcast attributes