[Zope] self-referential page design

Oliver Bleutgen myzope@gmx.net
Wed, 31 Jul 2002 22:52:38 +0200


Jeff Sacksteder wrote:

> I'm looking for general advice on how I can have a page that contains a
> search interface AND the results of that search. A detailed description
> follows.
> 
> I have page which displays summarized business information for the current
> month. It is composed of tables which describe the general layout, and each
> cell contains the results of various other dtml documents generated from
> zsql queries. 
> 
> I want to add a drop-down form to select the month you would like to view
> the information from. This I can do; let's call the field in the form
> input_month. Once I have the page loaded, I can select the month to view and
> all the component parts run their queries using the input_month parameter.
> Great. However, when I load the root document, input_month does not have an
> assigned value. By default , I want it to display the current month. I can
> derive that information with python script magic. What would be the best way
> to assign a value to that variable if it's current value is null? I have
> some ideas, but most of them are bad.


Maybe I'm just confused at the moment, but it's interesting that I don't 
find a simple _and_ nice solution for such a simple problem.
Ok, if your default value wouldn't be itself be dynamic, I'd use the 
default option for zsql-methods to insert a value for missing vars.
I.e. don't call zsql method calls with explicit variables, but let the 
zope namespace do the magic.
But I'm quite sure something like ZopeTime doesn't work there.
Probably calling python script instead of ZSQL methods directly? Not 
nice speedwise ....


cheers,
oliver