Plone 为zope组件提供向后兼容性
我正在开发的新版本中,浏览器视图(Plone 为zope组件提供向后兼容性,plone,zope,zope.component,Plone,Zope,Zope.component,我正在开发的新版本中,浏览器视图(imagetags manage)所携带的所有功能现在都移动到一个新适配器(尚未提交),该适配器提供与浏览器视图几乎相同的界面: class IManageTags(Interface): """ imagetags-manage view interface Tag management browser view """ def get_tag(id, create_on_fail=True): """
imagetags manage
)所携带的所有功能现在都移动到一个新适配器(尚未提交),该适配器提供与浏览器视图几乎相同的界面:
class IManageTags(Interface):
"""
imagetags-manage view interface
Tag management browser view
"""
def get_tag(id, create_on_fail=True):
""" Gets / creates a specific tag """
def get_tags():
""" Gets all the tags for the object """
def get_sorted_tags():
""" Sorted list of tags
"""
def save_tag(data):
""" Saves a tag with the passed data """
我真的不知道是否有人在项目中使用此产品,但是,我认为提供一些向后兼容机制是一个明智的想法,以防有人在开箱即用功能之外使用浏览器视图方法
我该怎么办?
是否将浏览器视图的界面与新适配器上中继的存根方法保持一致?
有什么建议吗?这种改变很难!这不是API的问题,而是设计的问题
- 浏览器视图是将使用/请求与上下文混合的组件
- 适配器是您不关心用户或其请求的组件
- 实用程序是您不关心上下文的组件
<gs:upgradeStep
title="Upgrade collective.myaddon from 1000 to 1010"
description=""
source="1000"
destination="1010"
handler=".upgrades.upgrade_1000_1010"
profile="collective.myaddon:default"/>
upgrades.py
def upgrade_1000_1010(context):
"""documentation
"""
context.runImportStepFromProfile(default_profile, 'viewlets')
portal_javascripts = getToolByName(context, 'portal_javascripts')
portal_javascripts.cookResources()
升级.py
def升级_1000_1010(上下文):
“”“文档
"""
runImportStepFromProfile(默认配置文件'viewlets')
portal\u javascripts=getToolByName(上下文“portal\u javascripts”)
portal_javascripts.cookResources()
这种改变很难!这不是API的问题,而是设计的问题
- 浏览器视图是将使用/请求与上下文混合的组件
- 适配器是您不关心用户或其请求的组件
- 实用程序是您不关心上下文的组件
<gs:upgradeStep
title="Upgrade collective.myaddon from 1000 to 1010"
description=""
source="1000"
destination="1010"
handler=".upgrades.upgrade_1000_1010"
profile="collective.myaddon:default"/>
upgrades.py
def upgrade_1000_1010(context):
"""documentation
"""
context.runImportStepFromProfile(default_profile, 'viewlets')
portal_javascripts = getToolByName(context, 'portal_javascripts')
portal_javascripts.cookResources()
升级.py
def升级_1000_1010(上下文):
“”“文档
"""
runImportStepFromProfile(默认配置文件'viewlets')
portal\u javascripts=getToolByName(上下文“portal\u javascripts”)
portal_javascripts.cookResources()
此问题可能更适合于产品开发人员列表:。@aclark,如果您认为我应该关闭此问题,请让我知道,并将其关闭。此主题将在另一个论坛()中讨论,正如@aclark所建议的。编辑:请结束这个问题。不要删除它以保留历史记录和跟进。此问题可能更适合于产品开发人员列表:。@aclark,如果您认为我应该关闭此问题,请让我知道,并将其关闭。此主题将在@aclark建议的其他论坛()中关注。编辑:请结束这个问题。不删除它以保留历史记录并跟进。