我需要在 trasmogrification 期间将字符串转换为 DateTime。像这样的东西:
[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: <conversion to DateTime>
我怎样才能做到这一点?
我需要在 trasmogrification 期间将字符串转换为 DateTime。像这样的东西:
[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: <conversion to DateTime>
我怎样才能做到这一点?
查看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'])