该.is_folderish
属性在很多地方使用。 例如,当设置一个对象作为默认视图或当激活在物体上的讨论 。
我的第一个问题是如何检查的对象有一个属性设置。 我尝试使用bin/instance debug
像这样的东西:
>>> app.site.news.is_folderish
...
AttributeError: is_folderish
我想,因为我不能就这样属性app.site.news
是一个包装到具有属性的对象。
我的第二个问题是如何在属性添加到一个新的敏捷对象。 我想我可以用下面的代码做(但我不能测试它的我的第一个问题解决之前)。
from zope import schema
from plone.dexterity.content import Item
class IHorse(form.Schema):
...
class Horse(Item):
def __init__(self):
super(Horse, self).__init__(id)
is_folderish = False
但我不知道这两个类是如何被联系起来。