[Cubicweb] add vocabulary options in migration process

Carlos Balderas carlos.balderas at gmail.com
Thu Mar 10 17:15:31 CET 2011


Hi List!

I am trying make a migration to change a static vocabulary in an attribute
of an entity.

I was wondering if "sync_schema_props_perms" in a migration file would do
the work?, because I still don't get this change done.

this is the case:

frequency = String(required=True,
                       description=_('how often this activity has to be
done'),
                       internationalizable=True,
                       vocabulary=(_('daily'), _('weekly'), _('monthly'),
_('annual')),
                       default='daily')

and I need to add two more options: permament and biweekly.

frequency = String(required=True,
                       description=_('how often this activity has to be
done'),
                       internationalizable=True,
                       vocabulary=(_('permanent'), _('daily'), _('weekly'),
                                   _('biweekly'), _('monthly'),
_('annual')),
                       default='daily')

What I did, was to make a the changes in the schema file and create a
migration file with:

sync_schema_props_perms('ProcessStage', syncperms=False, syncprops=True,
syncrdefs=False, commit=True)

where ProcessStage is the entity containing the attribute frecuency.

I run the migration process but the new vocabulary options are not added.

Could someone tell if this is the correct way to achieve what I need?

Thank you very much
Carlos Balderas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20110310/d57851d5/attachment.htm>


More information about the Cubicweb mailing list