diff -r 966d3241d2b4 -r 5ed0362bd674 pytask/templatetags/form_helpers.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pytask/templatetags/form_helpers.py Sun Jan 16 17:02:02 2011 +0530 @@ -0,0 +1,37 @@ +"""Module containing the templatetags for constructing forms. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', + ] + + +from django import template + + +register = template.Library() + + +@register.inclusion_tag('templatetags/_as_div_form.html') +def as_div_form(form, form_name, csrf_token, action_url, button_label): + """Returns a form to be constructed by the template specified. + """ + + return { + 'form': form, + 'form_name': form_name, + 'csrf_token': csrf_token, + 'action_url': action_url, + 'button_label': button_label, + } + + +@register.inclusion_tag('templatetags/_as_div_field.html') +def as_div_field(field): + """Returns the field for each div form field. + """ + + return { + 'field': field, + }