[Cubicweb] Integrating CubicWeb views into Pyramid (long)

Sylvain Thénault sylvain.thenault at logilab.fr
Tue Aug 26 17:44:24 CEST 2014


On 26 août 17:30, Christophe de Vienne wrote:
> 
> Le 26/08/2014 17:10, Sylvain Thénault a écrit :
> >On 06 août 11:39, Christophe de Vienne wrote:
> >>I do not think we do that in CubicWeb. All the predicates works with
> >>the current resultset (the pyramid context) or the current request,
> >>and the goal is always to select one view (and again, I talk only
> >>for the views, not the other appobjects).
> >Don't know if this is actually a problem, but at least in cubicweb, the notion
> >of "context" is not limited to the result set. Actually the context may be
> >anything given at selection time. Most of the selection are done based on data
> >type (hence rset), but you may imagine anything else (eg select on form values
> >(match_form_params predicate), select on arbitrary arguments (match_kwargs
> >argument), select on user groups (match_user_groups predicates), etc.
> 
> I did not use the term "context" when talking about cubicweb to
> avoid confusion.
> But basically it is the resultset and any information that can be
> found in the request.
> Same thing in pyramid : predicates operate on both the context
> (=resultset) and the request.

Hence my (attempt) explanation may be useful: this is not the same thing as what
I said above :p

In cubicweb, context may be more than the request (eg extra arguments given at
selection time). Like

   view = registry.select('someid', req, rset=rset, more=self)

with some predicates based on the optional `more` parameter (as `rset` btw).

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
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