Commit df6a5404 authored by Vincent Pelletier's avatar Vincent Pelletier

Replace hasattr by getattr.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15988 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 537eb066
...@@ -69,9 +69,9 @@ def SQLVar_render(self, md): ...@@ -69,9 +69,9 @@ def SQLVar_render(self, md):
'Invalid datetime value for <em>%s</em>: %r' % (name, v)) 'Invalid datetime value for <em>%s</em>: %r' % (name, v))
try: try:
if hasattr(v, 'ISO'): if getattr(v, 'ISO', None) is not None:
v=v.ISO() v=v.ISO()
elif hasattr(v, 'strftime'): elif getattr(v, 'strftime', None) is not None:
v=v.strftime('%Y-%m-%d %H:%M:%S') v=v.strftime('%Y-%m-%d %H:%M:%S')
else: else:
v=str(v) v=str(v)
......
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