def render_tag(tag, usertags, tag_search_prefix): vars = { "tag_search_prefix": tag_search_prefix, "usertags": usertags, "tag": tag, "subscribe_tag_form": subscribe_tag_form(initial={"tag": tag}), } return vars
def render_html(self): tags = self.all() tag_search_prefix = u"/{0}/tag/".format(self.instance.__class__.__module__.split('.')[1]) html = "" for tag in tags: html += render_to_string('tag_template.html',{"tag":tag, "tag_search_prefix":tag_search_prefix, "subscribe_tag_form":subscribe_tag_form(initial={'tag':tag})}) return html