1 # -*- coding: utf-8 -*-
3 # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
4 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 from django.contrib.auth.models import User
7 from django.db import models
8 from django.utils.translation import ugettext_lazy as _
9 from catalogue.models import Chunk
12 class BookPublishRecord(models.Model):
14 A record left after publishing a Book.
17 book = models.ForeignKey('Book', verbose_name=_('book'), related_name='publish_log')
18 timestamp = models.DateTimeField(_('time'), auto_now_add=True)
19 user = models.ForeignKey(User, verbose_name=_('user'))
22 app_label = 'catalogue'
23 ordering = ['-timestamp']
24 verbose_name = _('book publish record')
25 verbose_name = _('book publish records')
28 class ChunkPublishRecord(models.Model):
30 BookPublishRecord details for each Chunk.
33 book_record = models.ForeignKey(BookPublishRecord, verbose_name=_('book publish record'))
34 change = models.ForeignKey(Chunk.change_model, related_name='publish_log', verbose_name=_('change'))
37 app_label = 'catalogue'
38 verbose_name = _('chunk publish record')
39 verbose_name = _('chunk publish records')