thanks you for the quick answer..
one more question.. may be a little dumb :P
where is the best place to put this code?  so when I install the
product with the widget automatically change the widget
or may be with something like a behavior.

best regards

Gonzalo

On Thu, Apr 12, 2012 at 4:45 AM, Khairil Yusof <[email protected]> wrote:
> On 12/04/12 15:37, Mohd Izhar Firdaus Ismail wrote:
>>
>> Cool, :D
>>
>> On Thu, Apr 12, 2012 at 5:44 AM, Gonzalo Almeida<[email protected]>  wrote:
>>>
>>> I thought may be overriding the ICategorization behavior.. but I
>>> couldn't find a way to override a behavior
>>>
>>> anyone know how can I achieve this in dexterity?
>>>
>>
>> This is how i overridden ICategorization subject field with
>> collective.z3cform.keywordwidget.widget.KeywordFieldWidget
>>
>> from plone.autoform.interfaces import WIDGETS_KEY
>> from plone.directives.form.schema import TEMP_KEY
>> from plone.app.dexterity.behaviors.metadata import ICategorization
>> from zope import schema as _schema
>>
>> _directives_values = ICategorization.queryTaggedValue(TEMP_KEY)
>> _directives_values.setdefault(WIDGETS_KEY, {})
>> _directives_values[WIDGETS_KEY]['subjects'] =
>> 'collective.z3cform.keywordwidget.widget.KeywordFieldWidget'
>> _schema.getFields(ICategorization)['subjects'].index_name = 'Subject'
>
>
> Ideally this should the fix for the default dexterity behavior which is
> broken. It should work for dexterity as it does for standard Plone AT types.
>
>
>
>



-- 
Linux user #466939
_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to