web/widgets.py
branchtls-sprint
changeset 1704 d6f0e04d82bd
parent 1641 2c80b09d8d86
child 1977 606923dff11b
--- a/web/widgets.py	Wed May 06 09:47:50 2009 +0200
+++ b/web/widgets.py	Wed May 06 13:11:32 2009 +0200
@@ -735,12 +735,12 @@
         values = entity.attribute_values(self.name)
         if values and hasattr(values[0], 'strftime'):
             formatstr = entity.req.property_value(self.format_key)
-            return [values[0].strftime(formatstr)]
+            return [values[0].strftime(str(formatstr))]
         return values
 
     def render_example(self, req):
         formatstr = req.property_value(self.format_key)
-        return datetime.now().strftime(formatstr)
+        return datetime.now().strftime(str(formatstr))
 
 
     def _edit_render(self, entity):
@@ -759,7 +759,7 @@
         if example:
             help.append('<span>(%s: %s)</span>'
                         % (req._('sample format'), example))
-	help.append(u'</div>')
+        help.append(u'</div>')
         return u'&nbsp;'.join(help)
 
     def render_calendar_popup(self, entity):
@@ -791,8 +791,8 @@
         formatstr1 = req.property_value('ui.datetime-format')
         formatstr2 = req.property_value('ui.date-format')
         return req._('%(fmt1)s, or without time: %(fmt2)s') % {
-            'fmt1': datetime.now().strftime(formatstr1),
-            'fmt2': datetime.now().strftime(formatstr2),
+            'fmt1': datetime.now().strftime(str(formatstr1)),
+            'fmt2': datetime.now().strftime(str(formatstr2)),
             }