← Back to team overview

openerp-expert-framework team mailing list archive

Re: Removing context

 

A Dijous, 14 de gener de 2010, Christophe Simonis va escriure:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 14/01/10 15:56, Albert Cervera i Areny wrote:
> > A Dijous, 14 de gener de 2010, Albert Cervera i Areny va escriure:
> >> A Dijous, 14 de gener de 2010, Christophe Simonis va escriure:
> >>>> I know that sounds like a big change but I can't avoid thinking on how
> >>>> many  bug reports we would have avoided (and will avoid) just because
> >>>> developers keep forgeting passing context argument.
> >>>>
> >>>> It's true that there're lots of modules out there but most of them
> >>>> could be  updated with simple regular expressions.
> >>>>
> >>>> Of course, it also provides cleaner code and avoids typing a little
> >>>> bit of  code :P
> >>>
> >>> I think it's a great idea, but that also mean that the xmlrpc and
> >>> netrpc layers have to be rewritten...
> >>
> >> Are you sure? We implemented Pyro and not only it is very little code
> >> but also doesn't handle context anywhere...
> 
> Yes, I am.
> The signature of the *execute* method is
> 
>   def execute(self, db, uid, passwd, object, method, *args)
> 
> How will you extract the context from *args ?

Oh I see, I misunderstood you. 

Of course, remote calls should give context as the first parameter after 
method in all calls. Again, making it required would be a good thing IMHO.

> 
> - --
> Simonis Christophe
> Quality & Support Manager
> Open ERP - Tiny SPRL
> Chaussée de Namur, 40
> B-1367 Gérompont
> Tel: +32.81.81.37.00
> Web: http://openerp.com
> Blog: http://christophe-simonis-at-tiny.blogspot.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAktPSvwACgkQYeXc6dw+UFpFpQCfRELI93rpUDCjJ3k4wzIqJe29
> gnMAoIFtknZPQ/0+3Z8Ci44/dU9DlH5j
> =E3Z1
> -----END PGP SIGNATURE-----
> 


-- 
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18



References