← Back to team overview

openerp-community team mailing list archive

Re: Class or class_obj

 

Leonardo's et al,

I would prefer to define the project as the subset of OCA projects rather
than Odoo as a whole.

OCA keeps our conventions up to date and have discussions like this in the
open.
We also have control of them.
OCA conventions are generally far closer to pep8 making automated checking
much easier.
Odoo has mixed examples of everything all through their code.  Even for
this particular point you will see _pool, _model, _obj or nothing.

That said having read the arguments on both sides throughout the linked
issue I have no clue about what the convention should be. Personally I
prefer the CapWords argument, even though it diverges from PEP8. Really it
is used like a class but at the same time if you were reassigning say
StringIO within a local scope it would be lowercase (I don't know why you
would do this).  Given our existing convention of _obj I'd want very
widespread agreement to change and have that change clearly documented
before allowing PR's to use CapWords for models assigned from the registry
within a local scope.



On Mon, Nov 17, 2014 at 2:53 AM, Leonardo "LeartS" Donelli <
learts92@xxxxxxxxx> wrote:

> When global language conventions clash with "local" project
> conventions, basically all standards say to use the local one.
>
> In the first lines of PEP8:
> > Many projects have their own coding style guidelines. In the event of
> any conflicts, such project-specific guides take precedence for that
> project.
>
> A little later:
> > Some other good reasons to ignore a particular guideline:
> >
> > * When applying the guideline would make the code less readable, even
> for someone who is used to reading code that follows this PEP.
> > * To be consistent with surrounding code that also breaks it (maybe for
> historic reasons) -- although this is also an opportunity to clean up
> someone else's mess (in true XP style).
>
> So I'd say to prefer Odoo consistency at the moment, and push for a
> change in Odoo conventions at the same time, as some of those are
> really horrible.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References