views:

54

answers:

2

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 looks 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():

Please help me solve this problem. Thanks !

A: 

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...

celopes
+1  A: 

Problem has been resolved. Details link below:

http://code.google.com/p/django-tagging/issues/detail?id=91

Tran Tuan Anh
+1 for being through and posting the real answer here for others to find.
celopes