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

St├ęphane Bugat stephane.bugat at free.fr
Mon Oct 22 22:39:05 CEST 2012


> That could be simple. But is not, at least until we do some work on yams api. The pb is you want to change maxsize, and not e.g. fulltextindexed.
> "maxsize" argument, together with "vocabulary", are also syntactic sugar which actually add some constraints to the attribute.
> The problem is that the creation api is user friendly, but not the modification one, and you ends up having to do something like
>
>    descr_meta = Person.get_relation('description_format')
>    descr_meta.constraints = [SizeConstraint(newsize)] # suppose you don't have any other constraint
>
> This will work but is definitly not satisfying.
>
> Following this dicussion and the principles of least surprise, I propose to add two
> tickets on the yams project:
>
> * when an attribute is deleted, its meta attributes should be deleted as well
>
> * handle maxsize and vocabulary at schema building time and not before, so
>    one can modify building objects using same vocab as for creation
>   
Did not try your solution yet. But effectively, those two tickets could 
be handy for an easier scheme customisation.  Hum. However, I'm not 
feeling comfortable with creating those tickets on the yams project 
myself. Could you confirm that you intend to do it?

Stephane



More information about the Cubicweb mailing list