2

I need to convert a string into a DateTime during a trasmogrification. Something like this:

[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: <conversion to DateTime>

How can I achieve this?

Giacomo Spettoli
  • 4,476
  • 1
  • 16
  • 24

1 Answers1

2

Looking at the doc of collective.transmogrifier, I've found my answer:

[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: modules['DateTime'].DateTime(item['startDate'])
Giacomo Spettoli
  • 4,476
  • 1
  • 16
  • 24