I'm developing a content type in Dexterity and I have a field that is a
reference to another Dexterity content type (ISourcedocument) in the same
directory.
I'm sure this is simple to do, but for some reason I can't figure it out.
I'm trying to use plone.formwidget.contenttree ObjPathSourceBinder to
provide a selection of objects in the current directory. I can restrict it
to a certain type and review state using
"source=ObjPathSourceBinder(object_provides=ISourcedocument.__identifier__,
review_state=('new', 'active') ))," but I can't figure out how to restrict
it to the current directory since "self" and "context" are not defined.
My schema looks like this:
class ITask(form.Schema):
"""A task to be performed by a Staff member.
"""
title = schema.TextLine(
title=_(u"Task name"),
)
description = schema.Text(
title=_(u"Task summary"),
)
start = schema.Datetime(
title=_(u"Start date"),
required=False,
)
end = schema.Datetime(
title=_(u"End date"),
required=False,
)
form.widget(relateddocs=MultiContentTreeFieldWidget)
relateddocs = RelationList(
title=_(u"Related Documents"),
required=False,
default=[],
value_type=RelationChoice(
source=ObjPathSourceBinder(object_provides=ISourcedocument.__identifier__,
review_state=('new', 'active') )),
)
--
View this message in context:
http://plone.293351.n2.nabble.com/How-to-restrict-ObjPathSourceBinder-to-current-directory-tp5524252p5524252.html
Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers