Fundraising in PDF.
[wolnelektury.git] / src / push / models.py
1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
3 #
4 from django.db import models
5
6
7 class Notification(models.Model):
8     timestamp = models.DateTimeField(auto_now_add=True)
9     title = models.CharField(max_length=256, verbose_name='tytuł')
10     body = models.CharField(max_length=2048, verbose_name='treść')
11     image = models.ImageField(verbose_name='obraz', blank=True, upload_to='push/img')
12     message_id = models.CharField(max_length=2048)
13
14     class Meta:
15         ordering = ['-timestamp']
16
17     def __str__(self):
18         return '%s: %s' % (self.timestamp, self.title)