I am currently trying to write a custom generic comment app and
growing increasingly frustrated with template tags. As far as I can
tell, template tags are the only mechanism provided that allow pieces
of logic to be shared across templates. Nonetheless, you cannot treat
them like a view, and cannot do things like redirect. Someone asking
about essentially the exact same thing two years ago here:
http://groups.google.ca/group/django-users/browse_thread/thread/a060330d26444fee/8e2e6a1952df9624
and Malcolm commented that this was unusual and that isn't what
template tags are for and the logic should go in a view.

This isn't a satisfactory answer for me because the form logic in
question is identical regardless of the view/object. Why should anyone
be expected to duplicate form logic all over the project when it works
perfectly in a template tag without adding any repetitive code. The
only downside, as least in my case, is that I cannot redirect.

Here's my basic tag: http://dpaste.com/128910/

I'd like to know why my thinking is flawed and where I can actually
put this logic without cluttering up every view that needs a comment
form.

--

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.


Reply via email to