[Cubicweb] A few questions regarding CubicWeb customization

Sylvain Thénault sylvain.thenault at logilab.fr
Tue Sep 20 10:02:35 CEST 2011

On 20 septembre 09:19, Florent Cayré wrote:
> Le 20/09/2011 00:23, Fidel Viegas a écrit :
> >While reading the documentation and looking at a few cubes,
> >another question occurred to me. I was particularly looking at the
> >expenses cube, and the invoice came to my mind automatically.
> >Usually an invoice has a relationship with line items, where line
> >items are dependent on the invoice entity. If you delete the
> >invoice entity, automatically the line item is deleted because it
> >does not make much sense on its own. 

in cubicweb, this behaviour is handled using the 'composite' property
of relations when you define your schema.

> What I would like to know is
> >if there is any way to hide this entity and have it only shown in
> >an invoice. So, when you click on a new invoice, it automatically
> >has the link to add line items to its form (I figured how to do
> >this, so that is resolved). I just wanted to hide the line items
> >entities and show them only in the invoice entity form. Is this
> >possible? All the example cubes I have looked into have all the
> >entities available.
> >
> where do you want to hide them? In the invoice entity (primary)
> view? On their dedicated page (/<line items>)?

As Florent I'm not sure to understand what you expect here. By default,
setting 'composite' on a relation implies a few things such as:

* the related entity type isn't listed on the /manage view
* you'll be proposed to add new related entities through the 
  add sub-menu of the actions box

and may be a few others I've forgotten. All this is controlled through
the `uicfg` module (search the book for it, you'll get more explanation
about what you can or can't do with this).

> >PS: By the way, your framework is really nice. Had I discovered it
> >earlier, I would have solved quite a lot of problems I have
> >encountered when developing semantic web applications.

Nice to hear :) And hopefuly you'll discover more and more as you get in !

Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

More information about the Cubicweb mailing list