Venkatraman,
there was something I was missing, and just found the solution. The
tag is defined as (overly simplified)
@register.filter
@stringfilter
def cmstags(value, arg=None):
return '<b>%s</b>' % value
the value is the HTML content. And I needed another context-related
parameter in the filter as well.
And actually, I just found a way to pass an argument that I need to
filter.
So, where we're rendering,
{{ document.content|default_if_none:""|cmstags:document.id|textile|
safe }}
I just add ":document.id" to pass an argument in, and that's it. I
could also pass the whole context, but the ID is what I needed,
really.
Thanks!
On Jul 9, 2:15 pm, Venkatraman S <[email protected]> wrote:
> If you are using render_to_response to load a page and are using template
> tags in that page then pass the context (this in views.py for that app)
>
> For eg:
> def do_something(request):
> ...
> ...
> return render_to_response('multimedia.html', {'videos': videos} ,
> context_instance = RequestContext(request) )
>
> And in the template tag use something similar to:
> @register.inclusion_tag('news.html', takes_context = True)
> def show_news_sidebar(context):
> request = context['request']
> news = getNewsrequest)
> return {'news': news}
>
> Was that your problem or did i just misunderstood you?
>
> -V-http://twitter.com/venkasub
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.