On several occasions, I (and the templaters on my team) have needed a way to do datetime comparisons from within a template. The first example is testing if the pub_date on an object is today. Usually, I just end up writing a helper method on the model to do this; something like is_today. However, we've run into several instances where this wasn't possible or it would have just been too much of a mess to write these helper methods on every model. I then decided to create a little templatetag to take care of this for me.

Posted by Sean Stoops on March 8, 2008 | 0 comments

The SigB Links:

External Links:

Archives

RSS feeds

A Django project.
Made with vim