athomerson wrote:
> 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.
Not sure but I'd start with something like
path = '.'
Raphael
> 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: How to restrict ObjPathSourceBinder to
> current directory
> <http://plone.293351.n2.nabble.com/How-to-restrict-ObjPathSourceBinder-to-current-directory-tp5524252p5524252.html>
> Sent from the Product Developers mailing list archive
> <http://plone.293351.n2.nabble.com/Product-Developers-f293354.html> at
> Nabble.com.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Product-Developers mailing list
> [email protected]
> http://lists.plone.org/mailman/listinfo/product-developers
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers