1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.db import models
6 from django.utils.translation import ugettext_lazy as _
9 class Notification(models.Model):
10 timestamp = models.DateTimeField(auto_now_add=True)
11 title = models.CharField(max_length=256, verbose_name=_(u'title'))
12 body = models.CharField(max_length=2048, verbose_name=_(u'content'))
13 image = models.ImageField(verbose_name=_(u'image'), blank=True, upload_to='push/img')
14 message_id = models.CharField(max_length=2048)
17 ordering = ['-timestamp']
20 return '%s: %s' % (self.timestamp, self.title)