X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/6a259b96cff47e1fd64cbfd6f3d1e1d8e8b6486c..519e5664528bc9dd8cc7ff034fb9c2148a6db063:/apps/catalogue/models/publish_log.py diff --git a/apps/catalogue/models/publish_log.py b/apps/catalogue/models/publish_log.py index f422e377..7a8e2f9e 100755 --- a/apps/catalogue/models/publish_log.py +++ b/apps/catalogue/models/publish_log.py @@ -6,7 +6,7 @@ from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ -from catalogue.models import Chunk +from catalogue.models import Chunk, Image class BookPublishRecord(models.Model): @@ -22,7 +22,7 @@ class BookPublishRecord(models.Model): app_label = 'catalogue' ordering = ['-timestamp'] verbose_name = _('book publish record') - verbose_name = _('book publish records') + verbose_name_plural = _('book publish records') class ChunkPublishRecord(models.Model): @@ -36,4 +36,19 @@ class ChunkPublishRecord(models.Model): class Meta: app_label = 'catalogue' verbose_name = _('chunk publish record') - verbose_name = _('chunk publish records') + verbose_name_plural = _('chunk publish records') + + +class ImagePublishRecord(models.Model): + """A record left after publishing an Image.""" + + image = models.ForeignKey(Image, verbose_name=_('image'), related_name='publish_log') + timestamp = models.DateTimeField(_('time'), auto_now_add=True) + user = models.ForeignKey(User, verbose_name=_('user')) + change = models.ForeignKey(Image.change_model, related_name='publish_log', verbose_name=_('change')) + + class Meta: + app_label = 'catalogue' + ordering = ['-timestamp'] + verbose_name = _('image publish record') + verbose_name_plural = _('image publish records')