fix TimeField format_prop, use format_single_value directly in render_example stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 10 Jun 2009 12:08:57 +0200
branchstable
changeset 2086 be76ce00a05e
parent 2085 9e279029d7a0
child 2087 88fa02f50e71
fix TimeField format_prop, use format_single_value directly in render_example
web/formfields.py
--- a/web/formfields.py	Wed Jun 10 12:08:26 2009 +0200
+++ b/web/formfields.py	Wed Jun 10 12:08:57 2009 +0200
@@ -376,7 +376,7 @@
         return formatstr % float(value)
 
     def render_example(self, req):
-        return self.format_value(req, 1.234)
+        return self.format_single_value(req, 1.234)
 
 
 class DateField(StringField):
@@ -387,7 +387,7 @@
         return value and ustrftime(value, req.property_value(self.format_prop)) or u''
 
     def render_example(self, req):
-        return self.format_value(req, datetime.now())
+        return self.format_single_value(req, datetime.now())
 
 
 class DateTimeField(DateField):
@@ -395,7 +395,7 @@
 
 
 class TimeField(DateField):
-    format_prop = 'ui.datetime-format'
+    format_prop = 'ui.time-format'
     widget = TextInput