[z3-five] using getToolByName in utility

Dennis Schulz d.schulz81 at gmx.net
Thu Feb 1 11:04:33 CET 2007


Hello Yuppie,

I looked at EventTypeVocabulary in CMFCalendar.browser.event. 
In the Utitily itself I cant see any difference to mine.
Can you tell where it is used?

I my case does it make I create an adapter in the applychanges and then use the context of the adapter instead of the adapter?

set(adapter,newvalue)

Thanks,
Dennis

yuppie escribió:
> Hi Dennis!
>
>
> Dennis Schulz wrote:
>> In the applychanges the object is still wrapped into acquisition 
>> correctly.
>> and gets passed to field.set(adapter,newvalue) with the right context.
>>
>> In the set of the field the aq chain is ok as well
>> it calls then setattr(object, self.__name__, value)
>>
>> now the set of the alchemist ValidatedProperty is invoked.
>> in the set method there the aq_chain is destroyed.
>>
>> I dont know why the set is called without acquisition context.
>
> Acquisition isn't available in __setattr__ :(
>
> CMFCalendar.browser.event (on SVN trunk) does something similar, but 
> in that case an adapter is used. The wrapped object is the context of 
> the adapter, not the adapter itself. So the aq_chain is not destroyed 
> in __setattr__.
>
>> So you see any way to change something here?
>
> No idea. (Besides using an adapter.) The 'tools as local utilities' 
> work currently done on CMF trunk will make this much easier. You no 
> longer need Acquisition to get the tool (=utility).
>
>
> Cheers,
>
>     Yuppie
>
>




More information about the z3-five mailing list