- 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()
-
- if request.is_ajax():
+ cache_key='catalogue.catalogue'
+ output = permanent_cache.get(cache_key)
+ if output is None:
+ 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()