- tags = models.Tag.objects.exclude(
- category__in=('set', 'book')).exclude(book_count=0)
- tags = list(tags)
- for tag in tags:
- tag.count = tag.book_count
- categories = split_tags(tags)
- fragment_tags = categories.get('theme', [])
- collections = models.Collection.objects.all()
+ #cache_key = 'catalogue.catalogue/' + get_language()
+ #output = permanent_cache.get(cache_key)
+ output = None
+
+ if output is None:
+ common_categories = ('author',)
+ split_categories = ('epoch', 'genre', 'kind')
+
+ categories = split_tags(tags_usage_for_works(common_categories))
+ book_categories = split_tags(tags_usage_for_books(split_categories))
+ picture_categories = split_tags(
+ models.Tag.objects.usage_for_model(Picture, counts=True).filter(
+ category__in=split_categories))
+ # we want global usage for themes
+ fragment_tags = list(tags_usage_for_fragments(('theme',)))
+ collections = models.Collection.objects.all()