我需要在trasmogrification期间将字符串转换为DateTime。像这样:
[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: <conversion to DateTime>
我怎样才能做到这一点?
答案 0 :(得分:2)
查看collective.transmogrifier的文档,我找到了答案:
[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: modules['DateTime'].DateTime(item['startDate'])