Commit c9cbb578 authored by Yoshinori Okuji's avatar Yoshinori Okuji

support for date in listbox


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2424 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3d0b0e74
...@@ -1503,9 +1503,12 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')"> ...@@ -1503,9 +1503,12 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
#LOG('ListBox', 0, 'display_value = %r' % display_value) #LOG('ListBox', 0, 'display_value = %r' % display_value)
if type(display_value) == type(u''): if type(display_value) == type(u''):
display_value = display_value.encode('utf-8') display_value = display_value.encode('utf-8')
cell_body = my_field.render(value = display_value, REQUEST = o, key = key) if my_field.meta_type not in ('DateTimeField', ):
cell_body = my_field.render(value = display_value, REQUEST = o, key = key)
# We use REQUEST which is not so good here # We use REQUEST which is not so good here
# This prevents from using standard display process # This prevents from using standard display process
else: # Some fields prefer a None value to a ''
cell_body = my_field.render(value = attribute_original_value, REQUEST = o.asContext(REQUEST=REQUEST, form=REQUEST.form), key = key)
# It is safer to convert cell_body to an unicode string, because # It is safer to convert cell_body to an unicode string, because
# it might be utf-8. # it might be utf-8.
if type(cell_body) == type(''): if type(cell_body) == type(''):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment