[imp] merge nested tests in _dttime_format.__str__
bzr revid: xmo@tinyerp.com-20100214144204-0ary7dqew73j3jmr
This commit is contained in:
@@ -119,11 +119,10 @@ class _dttime_format(str, _format):
|
||||
self.val = value and str(value) or ''
|
||||
|
||||
def __str__(self):
|
||||
if self.val:
|
||||
if getattr(self,'name', None):
|
||||
return datetime.strptime(self.name, DHM_FORMAT)\
|
||||
.strftime("%s %s"%(self.lang_obj.date_format,
|
||||
self.lang_obj.time_format))
|
||||
if self.val and getattr(self,'name', None):
|
||||
return datetime.strptime(self.name, DHM_FORMAT)\
|
||||
.strftime("%s %s"%(self.lang_obj.date_format,
|
||||
self.lang_obj.time_format))
|
||||
return self.val
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user