There are my code:
{% load tag_cloud %}
{% tag_cloud_for_model blog.Entry as tags with steps=6 min_count=1 distribution=log %}
{% for tag in tags %}
<span class="tag-{{tag.font_size|add:"1"}}"><a href="/blog/tag/{{tag.name|slugify}}/">{{tag.name}}</a></span>
{% endfor %}
Everything loo开发者_开发知识库ks normal until I have 6 tag "django" in 6 different entries. The error is raised as follows:
TemplateSyntaxError at /blog/tags/
...
Caught an exception while rendering: invalid literal for int():
...
ValueError: invalid literal for int():
Not knowing anything about the tagging Module that you mention, I can only guess that the problem is on the {{tag.font_size|add:"1"}}
call. I think the value of one of your tag.font_size
is not numerical... Is it possible that some of the values is None or a non-digit character?
One way to find out is to remove momentarily the |add:"1"
and look at the generated HTML to see what is being rendered...
精彩评论