= Template Tags Cheat Sheet = == Inheritance and Inclusion == * {% extends "base.html "%} * {% block content %} ... {% endblock %} or {% block content %} ... {% endblock content %} * {% include "foo/bar.html" %} * {% ssi /home/html/ljworld.com/includes/right_generic.html %} == Filters and Tags == * {% load %} * {% filter [|...] %} == Control == * {% for o in some_list %} ... {% endfor %} * {% ifchanged %} (Content to check status of) {% endifchanged %} * {% if %} ... {% endif %} * {% if[not]equal user.id comment.user_id %} ... [{% else %}] ... {% endif[not]equal %} * {% cycle row1,row2 %} * {% cycle row1,row2 as rowcolors %} ** {% cycle rowcolors %} * {% firstof var1 var2 var3 %} * {% regroup people by gender as grouped %} ... {% for group in grouped %} {{ group.grouper }} ... == Others == * {% templatetag (openblock|closeblock|openvariable|closevariable|openbrace|closebrace) %} * {% widthratio this_value max_value 100 %} * It is {% now "jS F Y H:i" %} * {% spaceless %} ... {% endspaceless %} == Model fields Common option == * null = False * blank = False * choices = list_of_tuples * db_column = "column_name" * db_index = False * db_tablespace = "tablespace_name" * default = value_or_func * editable = True * help_text = "text" * primary_key = False * unique = False * unique_for_date = "date_field" * unique_for_month = "date_field" * unique_for_year = "date_field" See also [http://www.djangoproject.com/documentation/templates/ templates for designers].