X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/08e687e53ba84afd39646185142e59c6bfe77783..37cb52d2e87c491ded0b1f090afd403deaa5e616:/src/push/models.py diff --git a/src/push/models.py b/src/push/models.py index 54fd1a04b..3d86b9690 100644 --- a/src/push/models.py +++ b/src/push/models.py @@ -1,15 +1,14 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models -from django.utils.translation import gettext_lazy as _ class Notification(models.Model): timestamp = models.DateTimeField(auto_now_add=True) - title = models.CharField(max_length=256, verbose_name=_('title')) - body = models.CharField(max_length=2048, verbose_name=_('content')) - image = models.ImageField(verbose_name=_('image'), blank=True, upload_to='push/img') + title = models.CharField(max_length=256, verbose_name='tytuł') + body = models.CharField(max_length=2048, verbose_name='treść') + image = models.ImageField(verbose_name='obraz', blank=True, upload_to='push/img') message_id = models.CharField(max_length=2048) class Meta: @@ -17,3 +16,13 @@ class Notification(models.Model): def __str__(self): return '%s: %s' % (self.timestamp, self.title) + + +class DeviceToken(models.Model): + user = models.ForeignKey('auth.User', models.CASCADE) + token = models.CharField(max_length=1024, unique=True) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + class Meta: + ordering = ('-updated_at',)