From 062a80b51a89bf2361930461c0ad7ae5e36a2bdd Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 21 Feb 2014 11:49:48 +0100 Subject: [PATCH 1/1] Work list: don't care about types of objects on other pages. --- apps/catalogue/templates/catalogue/work-list.html | 4 ++-- apps/catalogue/templatetags/catalogue_tags.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/catalogue/templates/catalogue/work-list.html b/apps/catalogue/templates/catalogue/work-list.html index 6c1a7660f..fa33557d8 100755 --- a/apps/catalogue/templates/catalogue/work-list.html +++ b/apps/catalogue/templates/catalogue/work-list.html @@ -6,11 +6,11 @@ {% spaceless %}
    {% for item in object_list %} -
  1. +
  2. {% if item.short_html %} {{ item.short_html }} {# since we are using shor_html eerywhere, is it needed anymore? #} - {% elif item.object_type == "Picture" %} + {% elif item|class_name == "Picture" %} {% picture_short item %} {% else %} {% book_short item %} diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index 6ff60a3fb..bbd9f0719 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -365,9 +365,6 @@ def book_mini(book, with_link=True): @register.inclusion_tag('catalogue/work-list.html', takes_context=True) def work_list(context, object_list): request = context.get('request') - for obj in object_list: - obj.object_type = type(obj).__name__ - return locals() @@ -472,7 +469,7 @@ def related_tag_name(tag, lang=None): return _related_tag_name(tag, lang) -@register.simple_tag +@register.filter def class_name(obj): return obj.__class__.__name__ -- 2.20.1