diff -r 06ffdc68ab1b -r 1b4b4a9ac17b app/soc/views/helper/templatetags/forms_helpers.py --- a/app/soc/views/helper/templatetags/forms_helpers.py Sun Feb 15 14:55:53 2009 +0000 +++ b/app/soc/views/helper/templatetags/forms_helpers.py Sun Feb 15 14:56:30 2009 +0000 @@ -116,6 +116,21 @@ 'field_value': field_value} +@register.inclusion_tag('soc/templatetags/_as_readonly_table.html', + takes_context=True) +def as_readonly_table(context, form): + """Outputs a form as a properly formatted html table. + + Args: + form: the form that should be converted to a table + """ + + # create the bound fields + fields = [forms_in.BoundField(form, field, name) for name, field in + form.fields.items() if field] + + return {'fields': fields} + @register.inclusion_tag('soc/templatetags/_as_table.html', takes_context=True) def as_table(context, form): """Outputs a form as a properly formatted html table.