--- a/common/uilib.py Tue Sep 08 20:08:10 2009 +0200
+++ b/common/uilib.py Tue Sep 08 17:27:33 2009 -0700
@@ -31,7 +31,7 @@
return 'Any X WHERE X eid %s' % eid
-def printable_value(req, attrtype, value, props=None, displaytime=True):
+def printable_value(req, attrtype, value, props=None):
"""return a displayable value (i.e. unicode string)"""
if value is None or attrtype == 'Bytes':
return u''
@@ -46,8 +46,6 @@
if attrtype == 'Time':
return ustrftime(value, req.property_value('ui.time-format'))
if attrtype == 'Datetime':
- if not displaytime:
- return ustrftime(value, req.property_value('ui.date-format'))
return ustrftime(value, req.property_value('ui.datetime-format'))
if attrtype == 'Boolean':
if value:
--- a/entity.py Tue Sep 08 20:08:10 2009 +0200
+++ b/entity.py Tue Sep 08 17:27:33 2009 -0700
@@ -427,7 +427,7 @@
return value
def printable_value(self, attr, value=_marker, attrtype=None,
- format='text/html', displaytime=True):
+ format='text/html'):
"""return a displayable value (i.e. unicode string) which may contains
html tags
"""
@@ -457,7 +457,7 @@
return self.mtc_transform(value.getvalue(), attrformat, format,
encoding)
return u''
- value = printable_value(self.req, attrtype, value, props, displaytime)
+ value = printable_value(self.req, attrtype, value, props)
if format == 'text/html':
value = xml_escape(value)
return value
--- a/web/views/baseviews.py Tue Sep 08 20:08:10 2009 +0200
+++ b/web/views/baseviews.py Tue Sep 08 17:27:33 2009 -0700
@@ -66,7 +66,7 @@
_('%d minutes')
_('%d seconds')
- def cell_call(self, row, col, props=None, displaytime=False, format='text/html'):
+ def cell_call(self, row, col, props=None, format='text/html'):
etype = self.rset.description[row][col]
value = self.rset.rows[row][col]
@@ -98,7 +98,7 @@
else:
self.w(self.req.__('%%d%sseconds' % space) % int(value.seconds))
return
- self.wdata(printable_value(self.req, etype, value, props, displaytime=displaytime))
+ self.wdata(printable_value(self.req, etype, value, props))
# XXX deprecated
--- a/web/views/csvexport.py Tue Sep 08 20:08:10 2009 +0200
+++ b/web/views/csvexport.py Tue Sep 08 17:27:33 2009 -0700
@@ -51,7 +51,7 @@
row=rowindex, col=colindex)
else:
content = self.view('final', rset,
- displaytime=True, format='text/plain',
+ format='text/plain',
row=rowindex, col=colindex)
csvrow.append(content)
writer.writerow(csvrow)
--- a/web/views/editviews.py Tue Sep 08 20:08:10 2009 +0200
+++ b/web/views/editviews.py Tue Sep 08 17:27:33 2009 -0700
@@ -198,9 +198,9 @@
"""same as FinalView but enables inplace-edition when possible"""
id = 'editable-final'
- def cell_call(self, row, col, props=None, displaytime=False):
+ def cell_call(self, row, col, props=None):
entity, rtype = self.rset.related_entity(row, col)
if entity is not None:
self.w(entity.view('reledit', rtype=rtype))
else:
- super(EditableFinalView, self).cell_call(row, col, props, displaytime)
+ super(EditableFinalView, self).cell_call(row, col, props)
--- a/web/views/xmlrss.py Tue Sep 08 20:08:10 2009 +0200
+++ b/web/views/xmlrss.py Tue Sep 08 17:27:33 2009 -0700
@@ -95,8 +95,8 @@
val = self.view('textincontext', rset,
row=rowindex, col=colindex)
else:
- val = self.view('final', rset, displaytime=True,
- row=rowindex, col=colindex, format='text/plain')
+ val = self.view('final', rset, row=rowindex,
+ col=colindex, format='text/plain')
w(simple_sgml_tag(tag, val, **attrs))
w(u' </row>\n')
w(u'</%s>\n' % self.xml_root)