update librarian
[redakcja.git] / apps / catalogue / models / publish_log.py
index f422e37..6cc86d0 100755 (executable)
@@ -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 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):
 
 
 class BookPublishRecord(models.Model):
@@ -37,3 +37,18 @@ class ChunkPublishRecord(models.Model):
         app_label = 'catalogue'
         verbose_name = _('chunk publish record')
         verbose_name = _('chunk publish records')
         app_label = 'catalogue'
         verbose_name = _('chunk publish record')
         verbose_name = _('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 = _('image publish records')