X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1c27d409c8c48244f8bdf4664bc8e515eb096621..5e983f642ea537225bf3a20e97fca281c8fdc915:/apps/catalogue/models.py?ds=sidebyside diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index d0a620a96..ead5ba040 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -6,6 +6,7 @@ from datetime import datetime from django.db import models from django.db.models import permalink, Q +import django.dispatch from django.core.cache import cache from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User @@ -302,6 +303,8 @@ class Book(models.Model): tagged = managers.ModelTaggedItemManager(Tag) tags = managers.TagDescriptor(Tag) + html_built = django.dispatch.Signal() + class AlreadyExists(Exception): pass @@ -611,6 +614,7 @@ class Book(models.Model): new_fragment.save() new_fragment.tags = set(meta_tags + themes + [book_tag] + ancestor_tags) self.save() + self.html_built.send(sender=self) return True return False