[Zope] Zope question (while using Plone)

Christopher A. Nethery can at wasmerschroeder.com
Tue Nov 21 15:51:05 EST 2006


Thanks Maciej!

That really clarifies things for me.
Per your last question, I am building a custom page template in the ZMI
of my PLONE instance.

Should I be approaching this in a different way?


Thanks and best regards,

Chris


-----Original Message-----
From: Maciej Wisniowski [mailto:maciej.wisniowski at coig.katowice.pl] 
Sent: Tuesday, November 21, 2006 3:43 PM
To: Christopher A. Nethery
Cc: zope at zope.org
Subject: Re: [Zope] Zope question (while using Plone)

> ZSQL Method Arguments:
> 
> ----------------------
> 
> start_date, end_date
> 


>     <div tal:repeat="result here/DBTestQueryMethod">
So... where are the arguments? ;)


You need something like:
>     <div tal:repeat="result
python:here.DBTestQueryMethod(start_date='date1', end_date='date2')">


If I can advise, then use three objects:
1. index_html - Script(Python)
2. body - ZPT
3. DBTestQueryMethod - ZSQLMethod

index_html may be something like:
---------------------------------------
results = []
if request.has_key('start_date'):
    start_date = request.get('start_date', None)
    end_date = request.get('end_date', None)
    results = context.DBTestQueryMethod(start_date=start_date,
end_date=end_date)

body = context.body
return body(results=results)
---------------------------------------

and in body use:
---------------------------------------
<form action="index_html>
(...)
</form>

<div tal:define="results python: path('options/results|nothing') or []"
     tal:repeat="row results">
    your table
</div>
---------------------------------------


But where is Plone here??

-- 
Maciej Wisniowski


More information about the Zope mailing list