X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/5913c54d19b8f6775633176032161d49f9b2f1aa..0d32008f4ab55669ec5eb13ed1af3c2741092ef5:/src/catalogue/models/image.py diff --git a/src/catalogue/models/image.py b/src/catalogue/models/image.py index 646dd0ae..34f61f94 100755 --- a/src/catalogue/models/image.py +++ b/src/catalogue/models/image.py @@ -10,7 +10,6 @@ from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from catalogue.helpers import cached_in_field from catalogue.models import Project -from catalogue.tasks import refresh_instance from dvcs import models as dvcs_models @@ -25,7 +24,6 @@ class Image(dvcs_models.Document): project = models.ForeignKey(Project, null=True, blank=True) # cache - _short_html = models.TextField(null=True, blank=True, editable=False) _new_publishable = models.NullBooleanField(editable=False) _published = models.NullBooleanField(editable=False) _changed = models.NullBooleanField(editable=False) @@ -122,33 +120,13 @@ class Image(dvcs_models.Document): return not self.head.publishable changed = cached_in_field('_changed')(is_changed) - @cached_in_field('_short_html') - def short_html(self): - return render_to_string( - 'catalogue/image_short.html', {'image': self}) - - def refresh(self): - """This should be done offline.""" - self.short_html - self.single - self.new_publishable - self.published - def touch(self): update = { "_changed": self.is_changed(), - "_short_html": None, "_new_publishable": self.is_new_publishable(), "_published": self.is_published(), } Image.objects.filter(pk=self.pk).update(**update) - refresh_instance(self) - - def refresh(self): - """This should be done offline.""" - self.changed - self.short_html - # Publishing # ==========