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