openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #01781
Re: lp:~openerp-community/openerp-mgmtsystem/nc-extend into lp:openerp-mgmtsystem/6.1
On 14/12/2012 11:24, Daniel Reis (SECURITAS SA) wrote:
> Guewen: Thanks for the review; fixes are in progress.
>
> I'd like to know a little more about your remark «On the usage of namespaces, classes and instanciation of models».
> I did some browsing on the official addons, and found some cases where `from openerp.osv import fields, osv` instead of `from osv import fields, osv` (auth_openid, for instance).
>
> But I couldn't find examples for the other recommendations (import orm instead of osv; class on orm.Model instead of osv.osv; deprecate class instanciation after declaration).
>
> Do you have some links on resources for me to learn more on this?
> Thanks.
Hello Daniel,
The source code of osv/osv.py says that the osv class is deprecated.
Obviously it's not going to disapear in 7, but Model is clearer IMO that
osv (and not that much longer to type).
The model class instanciation is not deprecated. It's juste that it is
no longer required since OpenERP 6. You can keep it, but it is just
noise and visual clutter in the source code, hence the advice to drop it.
There are some things on the move in the official addons in trunk. I
submitted a merge proposal to clean up modules but it has not been
proposed so far (see
https://bugs.launchpad.net/openobject-server/+bug/1052392).
--
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com
https://code.launchpad.net/~openerp-community/openerp-mgmtsystem/nc-extend/+merge/139534
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openerp-mgmtsystem/nc-extend.
Follow ups
References