rohitjain-rj / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

templatetags for clouds don't work (Django 1.1 problem?) #215

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I just read issue 214 and it sounds like django-tagging doesn't work on
Django 1.1?  I didn't realise and have installed dt0.3 on my 1.1

Most things are working but the {% tag_cloud_for_model %} tag doesn't seem
to do anything. Watching connection.queries it seems it's not even querying
the db.

On the other hand if I call the cloud generating method directly (eg
Tag.objects.cloud_for_model(Video) ) and assign the result to a variable
from my view I can output that in the template and it has the correct data.

Any suggestions?  I'm trying to track it down myself but am very new to
Django currently so any pointers appreciated.

Original issue reported on code.google.com by bluesk...@gmail.com on 10 Sep 2009 at 4:42

GoogleCodeExporter commented 9 years ago
I did notice that the Django docs say:
"render() should never raise TemplateSyntaxError or any other exception. It 
should
fail silently, just as template filters should."

But in the tagging_tags.py that comes with django-tagging nearly every render 
method
potentially raises a TemplateSyntaxError.

I have tried raising my own TemplateSyntaxError in the render method at a point 
that
should always occur but I don't see any error, so it looks to me that Django is
hiding them. (If I raise an error in the TagCloudForModelNode __init__ then I 
do see it)

Original comment by bluesk...@gmail.com on 11 Sep 2009 at 10:17

GoogleCodeExporter commented 9 years ago
actually, it seems like the render method is not getting called at all - any 
idea why
that would be?

I have this in my template:

{% load tagging_tags %}

{% tag_cloud_for_model video.Video as tagcloud_tags with steps=6 min_count=1
distribution=log %}

TagCloudForModelNode __init__ gets called, but not render.

Original comment by bluesk...@gmail.com on 11 Sep 2009 at 11:18

GoogleCodeExporter commented 9 years ago
in the end I think it's some sort of naming conflict between the version of
tagging_tags.py in the site-packages/tagging/templatetags  and the one in my 
project
folder

I don't fully understand but it seemed if I don't have a copy in my
project/app/templatetags then I'd get an error about missing module, but if I 
made a
copy and put it there then I found that that wasn't the version of the file 
that was
actually used - it would use the version from site-packages instead!

Eventually I just made my own custom tag calling the Tag.objects methods 
directly.

Original comment by bluesk...@gmail.com on 11 Sep 2009 at 2:19