[Product-Developers] using contentmigration InlineFieldActionMigrator tranform doesn't seem to work

David Bain david.bain at alteroo.com
Wed Feb 27 17:38:54 UTC 2008


set up a custom migrator:

class MPANGFieldMigrator(InlineFieldActionMigrator):
    # source type info
    walkerClass = CatalogWalker
    src_meta_type = 'MPA'
    src_portal_type = 'MPA'

    dst_meta_type = 'MPA'
    dst_portal_type = 'MPA'

    fieldActions = ({'fieldName'    : 'country',
                       'storage'      : AttributeStorage(),

                       'transform'    : makeLower,
                                              },

                       )

The original value in the field is u'Mexico' but it doesn't end up
returning u'mexico' instead I get u'' after migration

The method 'makeLower'
is based on code from:
http://svn.plone.org/svn/collective/contentmigration/trunk/src/Products/contentmigration/tests/cmtc.py

def makeLower(obj, val, **kwargs):
    s = str(val)
    s = s.lower()
    val.update(s, obj)
    return val



More information about the Product-Developers mailing list