Useful Template Tags

All of the templatetags are located in templatetags/ You can look at more of them there. I am only going to talk about a few here.

To load the template tags this must be in your template

{% load scheduletags %}


{% querystring_for_date <date>[ <num>] %}

This template tag produces a querystring that describes date. It turns date into a dictionary and then turns that dictionary into a querystring, in this fashion:

>>> date = datetime.datetime(2009,4,1)
>>> querystring_for_date(date)

This is useful when creating links as the calendar_by_period view uses this to display any date besides The num argument can be used to say how specific you want to be about the date. If you were displaying a yearly calendar you only care about the year so num would only have to be 1. See the examples below

>>> querystring_for_date(date, num=1)
>>> # Now if we only need the month
>>> querystring_for_date(date, num=2)
>>> # Now everything except the seconds
>>> querystring_for_date(date, num=5)