[Zope3-Users] Customisation of addform

Florian Lindner mailinglists at xgm.de
Tue Nov 30 02:02:53 EST 2004


Roger Ineichen schrieb:
> Hi Florian
> 
> 
>>-----Original Message-----
>>From: Florian Lindner [mailto:mailinglists at xgm.de] 
>>Sent: Monday, November 29, 2004 10:05 AM
>>To: dev at projekt01.ch
>>Cc: zope3-users at zope.org
>>Subject: Re: [Zope3-Users] Customisation of addform
>>
>>Roger Ineichen schrieb:
>>
>>
>>>>Is there a piece of code to see how the addform is being 
>>>>generated? So I can see which macros and skin it uses.
>>
>>No, I think you missunderstood me.
>>The addform directive is creating the addform by using several macros 
>>and fill the slots in the macros. How do I know which macros 
>>and slots 
>>it is attempting to use?
>>
>>
>>>See zope.app.rotterdam.standardmacros.py
>>
>>macro_pages = ('skin_macros', 'view_macros', 'dialog_macros', 
>>navigation_macros')
>>
>>How does Zope knows which of these macro_pages to pick?
> 
> 
> Lookup in every macro page. Then a macro is registred as
> a view an theres no way to have to macros with the same name.
> So the Macros class can try till it's finds the macro in the 
> mapping like:
> 
> class Macros(object):
>     implements(IItemMapping)
> 
>     macro_pages = ()    
>     aliases = {
>         'view': 'page',
>         'dialog': 'page',
>         'addingdialog': 'page'
>         }
> 
>     def __getitem__(self, key):
>         key = self.aliases.get(key, key)
>         context = self.context
>         request = self.request
>         for name in self.macro_pages:
>             page = getView(context, name, request)
>             try:
>                 v = page[key]
>             except KeyError:
>                 pass
>             else:
>                 return v
>         raise KeyError, key
> 
> See in zope.app.basicskin.standardmacros.py

Ok, that's clear now.

Whats still really puzzling me is this question:

The addform directive is creating the addform by using several macros
and fill the slots in the macros. How do I know which macros
and slots it is attempting to use?
For example: I want to create a customize a containerView. How do I know 
which macros it uses and which slots it fills?

Thanks,
Florian



More information about the Zope3-users mailing list