[Zope] Zope question (while using Plone)
Maciej Wisniowski
maciej.wisniowski at coig.katowice.pl
Tue Nov 21 15:43:09 EST 2006
> 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