[Zope-CMF] CMF 2.2.0-beta reminder

yuppie y.2009 at wcm-solutions.de
Wed Dec 9 13:22:23 EST 2009


Hi!


Charlie Clark wrote:
> Am 02.12.2009, 21:04 Uhr, schrieb Charlie Clark <charlie at begeistert.org>:
> 
>> I think that we could work with a sensible default which might be
>> overwritable in the aliases?
> 
> I can think of two solutions here.
> 
> 1) Sensible default:
> 
> replace
> 
>          if self.add_view_expr:
>              lazy_map['url'] = self.add_view_expr_object
>              lazy_keys.append('url')
>          else:
>              lazy_map['url'] = ''
> 
> with
> 
>          if not self.add_view_expr:
>              url = "string:${folder_url}/++add++%s" % self.getId()
>              self._setPropValue('add_view_expr', url)
>          lazy_map['url'] = self.add_view_expr_object
>          lazy_keys.append('url')
> 
> This leaves add_view_expr as an editable property but will create it if  
> required and it can be edited afterwards. This means you don't need to  
> worry about typos when creating or copying new portal types, you just have  
> to make it an empty string.

-1

I don't think a write-on-read solution is acceptable.


> 2) Uneditable TypeInfo method
> 
> Apart from transparency I can't see any reason for making this value  
> editable so it could be implemented as a property doing much the same as  
> above.

-1

For several reasons I think this should be an expression:

- At the moment you can specify any kind of add view name and 
implementation. E.g. you can use a skin method or set an alias.

- The traverser is configured in ZCML and its name can easily be 
changed. I don't think it is a good idea to hardcode assumptions about 
configuration in the type info code.

- Type infos are now also Action objects and should be configured in a 
similar way as normal Actions.


> Thoughts?

I'm afraid any attempt to make this simpler also makes it less explicit 
and less flexible.


Cheers,

     Yuppie



More information about the Zope-CMF mailing list