- def flush_includes(self, languages=True):
- if not languages:
- return
- if languages is True:
- languages = [lc for (lc, _ln) in settings.LANGUAGES]
- flush_ssi_includes([
- template % (self.pk, lang)
- for template in [
- '/katalog/f/%d/short.%s.html',
- '/api/include/fragment/%d.%s.json',
- '/api/include/fragment/%d.%s.xml',
- ]
- for lang in languages
- ])
+ @cached_render('catalogue/fragment_short.html')
+ def midi_box(self):
+ return {'fragment': self}
+
+ @cached_render('catalogue/fragment_promo.html')
+ def promo_box(self):
+ return {'fragment': self}
+
+ @property
+ def themes(self):
+ return self.tags.filter(category='theme')
+
+ def clear_cache(self):
+ clear_cached_renders(self.midi_box)
+ clear_cached_renders(self.promo_box)