Am 02.12.2009, 21:04 Uhr, schrieb Charlie Clark <char...@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.

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.

Thoughts?

Charlie
-- 
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226
_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Reply via email to