Thank you, David, that's great news indeed!
Philip

Am 08.03.2014 um 20:18 schrieb David Glick (Plone) <david.gl...@plone.org>:

> On 2/26/14, 12:28 PM, ajung wrote:
>> I have a custom Dexterity type with a RelationField
>> 
>>  54     media = RelationChoice($
>>  55         title=_(u"label_podcast_item_media"),$
>>  56         description=_(u"help_podcast_item_media"),$
>>  57
>> source=ObjPathSourceBinder(object_provides=IMediaItem.__identifier__),$
>>  58         required=False,$
>>  59     )  $
>> 
>> that should make use of the plone.app.widgets's widget of the related items
>> field.
>> 
>> I was reading through dx.py and dx_bbb.py but I don't get the point how to
>> reuse
>> the existing widget here. Any pointer?
>> 
> This week I did some work on adding support for sources in plone.app.widgets.
> 
> Now, with master of plone.app.vocabularies and plone.app.widgets, you can 
> import plone.app.vocabularies.catalog.CatalogSource and do this:
> 
> media = RelationChoice(
>    title=_(u"label_podcast_item_media"),
>    description=_(u"help_podcast_item_media"),
>    source=CatalogSource(object_provides=IMediaItem.__identifier__),
>    required=False,
> )
> 
> and it will query the source when searching in the widget.
> 
> With my changes it's also now possible to use a plain Choice field with this 
> source instead of RelationChoice, if you want to store a UUID rather than 
> creating a relation.
> 
> David
> _______________________________________________
> Product-Developers mailing list
> product-develop...@lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to