Merge lp://qastaging/~openerp-dev/openobject-server/trunk-reexport-thu into lp://qastaging/openobject-server

Proposed by Vo Minh Thu
Status: Needs review
Proposed branch: lp://qastaging/~openerp-dev/openobject-server/trunk-reexport-thu
Merge into: lp://qastaging/openobject-server
Diff against target: 136 lines (+61/-9)
5 files modified
openerp/__init__.py (+2/-1)
openerp/fields.py (+25/-0)
openerp/models.py (+6/-0)
openerp/osv/fields.py (+23/-2)
openerp/tests/addons/test_uninstall/models.py (+5/-6)
To merge this branch: bzr merge lp://qastaging/~openerp-dev/openobject-server/trunk-reexport-thu
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+146372@code.qastaging.launchpad.net

Description of the change

Time for some bikeshedding:

    # 0
    from openerp import *
    class res_user(Model):
      _columns = { 'name': Char() }

    # 1
    from openerp import exceptions, fields, models
    class res_user(models.Model):
      _columns = { 'name': fields.Char() }

    # 2
    import openerp
    class res_user(openerp.Model):
      _columns = { 'name': openerp.Char() }

    # 3
    import openerp
    class res_user(openerp.models.Model):
      _columns = { 'name': openerp.fields.Char() }

I think I like #1: openerp is not just an orm, so having openerp re-exporting the (admitedly commonly used) Model, Char, ... symbols seems to stress too much the orm side.

We also have openerp.exceptions which provides Warning, AccessDenied, AccessError. I like those to be on the same level as Model, Char, ... (which is the case when openerp.models lives side by side with openerp.fields).

But openerp is also about the workflows, the WSGI stack, import/export, reporting, maybe about process monitoring (I wish it was not), ... and really the use of models.Model, and fields.Char is just a few more characters among thousands of lines.

Thoughts?

To post a comment you must log in.
4770. By Vo Minh Thu

[REF] export (possibly renamed) models and fields.

4771. By Vo Minh Thu

[REF] use the newly reexported symbols from models and fields.

4772. By Vo Minh Thu

[FIX] reexport: reexporting fields from models was a mistake.

Unmerged revisions

4772. By Vo Minh Thu

[FIX] reexport: reexporting fields from models was a mistake.

4771. By Vo Minh Thu

[REF] use the newly reexported symbols from models and fields.

4770. By Vo Minh Thu

[REF] export (possibly renamed) models and fields.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.