[Cubicweb] Correct use of the 'person' cube

St├ęphane Bugat stephane.bugat at free.fr
Wed Jul 11 08:42:17 CEST 2012


Dear all,

I want to use the 'person' cube so that each CWUser belonging to the 'users' group has a Person instance defined. For that I have decided to create an inlined relation definition between CWUser and Person (with a '11' cardinality).
However, there are common attributes between both entities (first name, email, and so on).

Just to make sure there is no other and simpler approach to deal with it:
A solution is to define a hook for the creation of each CWUser that automatically creates the corresponding Person and predefines its attributes with the corresponding values of the CWUser attributes (using a 'after_add_entity' event).

Is this correct?

Thanks




More information about the Cubicweb mailing list