app/soc/views/helper/templatetags/forms_helpers.py
changeset 1815 7a9b69f36111
parent 1714 bfdef9380954
child 1820 ecc40aa58e19
--- a/app/soc/views/helper/templatetags/forms_helpers.py	Thu Mar 12 22:29:14 2009 +0000
+++ b/app/soc/views/helper/templatetags/forms_helpers.py	Thu Mar 12 22:30:04 2009 +0000
@@ -70,7 +70,7 @@
 
 
 @register.inclusion_tag('soc/templatetags/_readonly_field_as_table_row.html')
-def readonly_field_as_table_row(field_label, field_value):
+def readonly_field_as_table_row(label, value):
   """Prints a field value and it's verbose name as a table row.
 
   This function actually does very little, simply passing the 
@@ -98,17 +98,23 @@
       { 'field_label': field_label',
         'field_value': field_value'}
   """
-  return {'field_label': field_label,
-          'field_value': field_value}
+
+  value = value.strip() if isinstance(value, basestring) else value
+
+  return {'field_label': label,
+          'field_value': value}
 
 
 @register.inclusion_tag(
     'soc/templatetags/_readonly_field_as_twoline_table_row.html')
-def readonly_field_as_twoline_table_row(field_label, field_value):
+def readonly_field_as_twoline_table_row(label, value):
   """See readonly_field_as_table_row().
   """
-  return {'field_label': field_label,
-          'field_value': field_value}
+
+  value = value.strip() if  isinstance(value, basestring) else value
+
+  return {'field_label': label,
+          'field_value': value}
 
 
 @register.inclusion_tag(