[Cubicweb] Modification of attributes of entities already in the scheme

St├ęphane Bugat stephane.bugat at free.fr
Mon Oct 22 17:25:36 CEST 2012


Dear all,

I'd like to modify some attributes of the entities imported in my scheme through the other cubes. For instance, let's suppose I'd like to transform the 'description' attribute of the Person entity into a simple String and not a RichString, with a maximum size.
I've tried the following:

   from cubes.person.schema import Person
   
   Person.remove_relation('description')
   Person.add_relation(String(required=False,
           fulltextindexed=True,
           description=_('Description'),
           maxsize=300),
       name='description',)

But this does not seems to work at all, although no error is raised. How do I have to proceed?
Thanks.

Stephane




More information about the Cubicweb mailing list