[Zope3-dev] Re: Script (Python), was Re: [Zope-dev] Re: Zope 3 Newsletter: Issue 10

Martijn Faassen faassen at vet.uu.nl
Tue Sep 9 17:57:22 EDT 2003


Sidnei da Silva wrote:
> Currently, for the edit and add views, there is something like this:
> 
> <div tal:repeat="widget view/widgets">
>   <span tal:replace="widget/row" />
> </div>
> 
> Where row is a method of the widget that returns a chunk of HTML. For
> making this introspectable, I guess it would be needed to make the
> widgets return a macro, that is then used.

Well, it's introspectable already in the sense that you can ask
the view for the list of 'widgets' apparently. But you could make it
introspectable-by-macros by doing it with macros, I guess. But I'm not
sure I see the benefit.

Perhaps there is an abstract model lying *below* page template macros
(at least semantically) that can be accessed through some API to get a
tree-like way of looking at a page layout. This same API could also
be implemented by other code such as the form rendering code. This
mean introspection would always be possible through this API.

Of course it wouldn't be useful if you want to be able to manipulate
such a tree with a bunch of constraints (X so much to the left of Y) like
GUI widget toolkits can do. But it'd be useful for generalized introspection,
and rendering code might be built on top of this information too.

Regards,

Martijn




More information about the Zope3-dev mailing list