[Cubicweb] Understanding _cw

Sylvain Thénault sylvain.thenault at logilab.fr
Fri May 16 10:22:41 CEST 2014


On 16 mai 10:05, Christophe de Vienne wrote:
> The most simple solution is to separate in 2 or 3 attributes/params.
> - cw for config, reg and repo, because it is all the instance-wide objects
> - cnx when a connection but no request is needed.
> - request when a request is needed.

sounds good, though I would rephrase the two last points: 
- cnx when a connection to the repo is established
- request when the originator is an HTTP request

Take care that in some case, we'll have to process an HTTP request without a
connection being established (eg register/lost password form for site where
anonymous are not allowed).

> The request object could have a 'cnx' attribute.
> We could even have a 'cw' attribute on cnx, removing the need for a cw
> argument when calling appobjects.

This is not clear to me. Currently the cw is an argument mostly because of it
being the request object.
-- 
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