[Zope-CMF] DynamicType.portal_type

yuppie y.2015 at wcm-solutions.de
Tue Jan 27 11:54:15 CET 2015


Hi!


yuppie wrote:
> http://svn.zope.org/?view=rev&revision=130422 changes the default value
> of DynamicType.portal_type from None to an empty string.
> 
> getPortalTypeName returns this value and the interface still says:
> 
>     def getPortalTypeName():
>         """ Return the name of the type information for this object.
> 
>         o If the object is uninitialized, return None.
> 
>         o Permission:  Public
>         """
> 
> In several places the code relies on this and checks for None.
> 
> There is no test that shows what was broken and fixed. AFAICS there is
> nothing wrong with using None for uninitialized objects. We just have a
> new requirement in Products.ZCatalog 3: Attributes with None values can
> no longer be indexed.
> 
> Wouldn't it be better to adjust the portal_type just for indexing in the
> IndexableObjectWrapper?

Fixed the issue this way:

- reverted r130422

- adjusted the IndexableObjectWrapper

I guess other indexed attributes can also contain None. Not sure if
converting them to an empty string is always the best solution.


Cheers,

	Yuppie



More information about the Zope-CMF mailing list