X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ce8d791a5298e0cb2569034aec4c8b57afac97b2..d4cd02c048d596c06db45e972489aeb373adeb78:/apps/catalogue/models/publish_log.py diff --git a/apps/catalogue/models/publish_log.py b/apps/catalogue/models/publish_log.py index f422e377..2dfff9ec 100755 --- a/apps/catalogue/models/publish_log.py +++ b/apps/catalogue/models/publish_log.py @@ -1,39 +1,23 @@ # -*- coding: utf-8 -*- # -# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. +# This file is part of MIL/PEER, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from django.contrib.auth.models import User +from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ -from catalogue.models import Chunk +from dvcs.models import Revision -class BookPublishRecord(models.Model): - """ - A record left after publishing a Book. - """ +class PublishRecord(models.Model): + """A record left after publishing a Document.""" - book = models.ForeignKey('Book', verbose_name=_('book'), related_name='publish_log') + document = models.ForeignKey('catalogue.Document', verbose_name=_('document'), related_name='publish_log') + revision = models.ForeignKey(Revision, verbose_name=_('revision'), related_name='publish_log') timestamp = models.DateTimeField(_('time'), auto_now_add=True) - user = models.ForeignKey(User, verbose_name=_('user')) + user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user')) class Meta: - app_label = 'catalogue' ordering = ['-timestamp'] verbose_name = _('book publish record') - verbose_name = _('book publish records') - - -class ChunkPublishRecord(models.Model): - """ - BookPublishRecord details for each Chunk. - """ - - book_record = models.ForeignKey(BookPublishRecord, verbose_name=_('book publish record')) - change = models.ForeignKey(Chunk.change_model, related_name='publish_log', verbose_name=_('change')) - - class Meta: - app_label = 'catalogue' - verbose_name = _('chunk publish record') - verbose_name = _('chunk publish records') + verbose_name_plural = _('book publish records')