misc/migration/2.99.0_Any.py
author Katia Saurfelt <katia.saurfelt@logilab.fr>
Wed, 22 Apr 2009 15:40:58 +0200
changeset 1430 708233d644da
parent 176 312024cbe717
child 1398 5fe84a5f7035
permissions -rw-r--r--
some feed aggregators (eg sage) show dc:creator tag, so we show it insteed of author tag

from cubicweb import CW_MIGRATION_MAP

for pk, in rql('Any K WHERE X is EProperty, X pkey IN (%s), X pkey K'
               % ','.join("'system.version.%s'" % cube for cube in CW_MIGRATION_MAP),
               ask_confirm=False):
    cube = pk.split('.')[-1]
    newk = pk.replace(cube, CW_MIGRATION_MAP[cube])
    rql('SET X pkey %(newk)s WHERE X pkey %(oldk)s',
        {'oldk': pk, 'newk': newk}, ask_confirm=False)
    print 'renamed', pk, 'to', newk

add_entity_type('ECache')