Custom template tag for a chaptered document?

0 views
Skip to first unread message

Stodge

unread,
Dec 29, 2009, 7:26:41 PM12/29/09
to Django users
I need to write a custom tag. I have a hierarchy of objects that I
want to turn into a chaptered document. But I want to be able to build
and display the document in a template AND generate a PDF or other
format from a view. Can I write a custom template tag and use it in a
template and from a view?? Or is there already something like this out
there

Tomasz Zieliński

unread,
Jan 3, 2010, 7:58:14 AM1/3/10
to Django users

You could write a function that does what you need and can be used in
views,
then write template tag as an thin adaptor around this function - so
that
you can use it in templates.

--
Tomasz Zielinski
http://pyconsultant.eu

Reply all
Reply to author
Forward
0 new messages