Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !818

ZODB Components: Likewise Document, add Mixin (erp5.component.mixin) and Interface (erp5.component.interface).

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Arnaud Fontaine requested to merge arnau-TM-components-Interface-Mixin into master Dec 21, 2018
  • Overview 7
  • Commits 1
  • Pipelines 0
  • Changes 36

Tests passed: https://nexedi.erp5.net/test_result_module/20190204-2FBF0BAF

@nexedi Before refactoring and cleaning up, I wanted to confirm that having one Interface/Mixin per ZODB Component would be fine (AFAIK there is no convention about that). Because like Documents, this would allow using the reference to list them (such as in BaseType_view) instead of importing all the modules and then getting the classes of each one of them (not a problem with current filesystems Mixin/Interfaces but costly with ZODB Components, eg modify Portal Type → reset → get all the classes again). Currently, it seems to be the cases for Mixins (or at least most of them) but not for Interfaces where one file sometimes define several Interfaces.

Some background information about current implementation: with filesystem implementation, when listing available Mixins and Interfaces on a Portal Type view (BaseType_view through respectively getMixinTypeList() and getInterfaceTypeList()):

  • For Mixins, done on each Product initialization (Products.ERP5Type.Utils.initializeProduct()):
    • Check that the Product has a mixin submodule and if it does:
      1. Import the module.
      2. Get all class members (inspect.getmembers()), except Exception classes, and add them to mixin_class_registry dict later used in getMixinTypeList().
  • For Interfaces, only for ERP5Type Product Interfaces:
    1. Import Products.ERP5Type.interfaces.
    2. Return all of its classes (inspect.getmembers()) as all Interfaces are explicitely imported in its __init__.py.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: arnau-TM-components-Interface-Mixin
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7