- 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/p/%d/short.%s.html',
- '/katalog/p/%d/mini.%s.html',
- ]
- for lang in languages
- ])
-
- def search_index(self, picture_info=None, index=None, index_tags=True, commit=True):
- if index is None:
- from search.index import Index
- index = Index()
- try:
- index.index_picture(self, picture_info)
- if index_tags:
- index.index_tags()
- if commit:
- index.index.commit()
- except Exception as e:
- index.index.rollback()
- raise e