[z3-five] using getToolByName in utility

yuppie y.2007- at wcm-solutions.de
Thu Feb 1 16:16:09 CET 2007


Hi Dennis!


Dennis Schulz wrote:
> To make use of the adapter like you did the Products.CMFDefault.formlib 
> is necessary?
> The Products.CMFDefault.formlib package is not included into Plone 2.5.2 
> I am working with. I guess it will be part of Plone 3.0.
> Can I use it in Plone 2.5.2?

I never used alchemist, but I doubt using Products.CMFDefault.formlib in 
combination with alchemist makes much sense. And without modifications 
you can't use that code in Plone 2.5.2 anyway.

Other possible approaches:

- The right way to solve your problem would be using a local site 
manager. Even if your tools are not registered as utilities, you can get 
hold of the site root and therefor of the tool without using 
acquisition. Plone 3.0 might give you some hints how to set this up.

- If you don't need the validation at field level, the easiest solution 
might be subclassing the field and disabling the validation by 
overriding validate().


HTH,

	Yuppie



More information about the z3-five mailing list