Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 136
    • Merge requests 136
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !818

Merged
Created Dec 21, 2018 by Arnaud Fontaine@arnauDeveloper

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

  • Overview 7
  • Commits 1
  • 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
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: arnau-TM-components-Interface-Mixin
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7