[Cubicweb] Making changes to cubes
aurelien.campeas at gmail.com
Sat Dec 11 21:28:18 CET 2010
2010/12/11 Fletcher, John P <j.p.fletcher at aston.ac.uk>
> I am working in user mode and modifying the schema.py file of a cube
> as suggested in the documentation. e.g.
> What is not working is that the new version is not being picked up.
> Example, I have modified schema.py for person to add the additional option
> of Dr as a title.
> civility = String(required=True, internationalizable=True,
> vocabulary=(_('Mr'), _('Ms'), _('Mrs'),_('Dr')),
> What do I have to do to get that used? I have tried stopping, upgrading
> and restarting.
> It has not changed.
Yes. Modifying schema.py on disk does not entail an automatic update of some
To update a vocabulary (any constraint actually) you must issue a
"sync_schema_props_perms" per instance.
You can immediately drop into a shell and apply it::
# cubicweb-ctl shell myappinstance
* create a migration file in myapp/migration/0.5.2_Any.py (makes sense if
current version number is 0.5.1) containing the above call
* bump the version number attribute of the __pkginfo__.py module in the
# cubicweb-ctl upgrade myappinstance
> Is it still using the copy in /usr/shared/cubicweb/cubes?
> I have also tried to modify folder as indicated here:
> by adding this code to the schema.py of folder.
> class missing_filed_under(RelationDefinition):
> name = 'filed_under'
> subject = ('Card', 'File')
> object = 'Folder'
> I want to be able to put either a file or a card into a folder.
> I have not had any luck with that either.
the following migration instruction must be issued (using either of the
add_relation_definition('Card', 'filed_under', 'Folder')
Note that for real development, you certainly want to do this in you own
> I am clearly missing something.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cubicweb