Hi all,
Im trying to add tags to my blog post. i did it its done but i wanted more so when users click the link of tag, they will see other post tagged same. anyway
here my view_tag function
def view_tag(request, tag_id):
tag = Tag.objects.get(pk=tag_id)
news = tag.pnews_set.all()
return render_to_response("tags.html", {"tag_id":tag_id, "news":news, "tag":tag})
my problem is i cant load any value at the template i saw at example he just write
{{news.name}}
and saw the result but i can.
when i write
{{tag.pnews_set.all}}
i can see these
[<pnews: Sitemiz Test Yayınında>, <pnews: Deneme Yazısı>]
but i want to use something like this:
{%for pnews in news%}
{{pnews.name}}
{%endfor%}