[Zope-dev] ZPatterns + Skinscript
Joachim Schmitz
js@aixtraware.de
Tue, 31 Oct 2000 16:00:22 +0100 (CET)
Hi Steve,
that did it, many thanks, how did you debug this ? By the way, it only work
if specify a DataSkin derived ZClass under the Storage tab.
it solved also the problem with the following setup, which
didn't work before applying the patch, with an setup like this:
SkinScript method:
WITH QUERY readEvents(e_id=self.id) COMPUTE
event_id=event_id,zeiten=zeiten,firma=firma
,tel=tel,movie_id=movie_id,movie_text=movie_text
,movie_link=movie_link,movie_title
,datum_von=datum_von,datum_bis=datum_bis
SQL-method readEvents
parameter:
e_id:int
Querytemplate:
select e.event_id as event_id
,e.zeiten as zeiten
,v.firma as firma
,v.tel as tel
,e.movie_id as movie_id
,m.movie_title as movie_title
,m.movie_link as movie_link
,m.movie_text as movie_text
,e.datum_von as datum_von
,e.datum_bis as datum_bis
from event as e, veranstalter as v, movies as m
where
e.event_id = <dtml-sqlvar e_id type=int>
and e.movie_id = m.movie_id and e.veran_id = v.veran_id
dtml-method:
<dtml-in getcurrentEventIDs>
<dtml-let theItem="getItem(key=_.int(event_id))">
<dtml-var theItem>
<dtml-if "_.hasattr(theItem,'movie_title')">
<dtml-with theItem>
<tr>
<td>
<a href=<dtml-var event_id>><dtml-var movie_title></a>
</td>
<td>
<dtml-var zeiten>
</td>
<td>
<dtml-var firma>
</td>
</tr>
</dtml-with theItem>
</dtml-if theItem>
</dtml-let theItem="getItem(_.int(_['sequence-item']))">
</dtml-in getcurrentEventIDs>
On Tue, 31 Oct 2000, Steve Spicklemire wrote:
>
> OK I think I found the problem(s):
>
> *** Expressions.py 2000/10/18 23:11:55 1.1.1.3
> --- Expressions.py 2000/10/31 14:14:09
> ***************
> *** 133,139 ****
> def eval(self,mapping):
> """Return the result of looking up/calling the name from 'mapping'.
> If the object was created with 'call==1', call it before returning it."""
> ! return md.getitem(self.name,self.call)
>
>
> del Eval, expr_globals, TemplateDict, Base, ComputedAttribute
> --- 133,139 ----
> def eval(self,mapping):
> """Return the result of looking up/calling the name from 'mapping'.
> If the object was created with 'call==1', call it before returning it."""
> ! return mapping.getitem(self.name,self.call)
>
>
> del Eval, expr_globals, TemplateDict, Base, ComputedAttribute
>
> *** SkinScript/Compiler.py 2000/10/18 23:11:56 1.1.1.4
> --- SkinScript/Compiler.py 2000/10/31 14:12:09
> ***************
> *** 168,174 ****
>
> class Compute(AST):
> type = 'COMPUTE'
> ! def __init__(self,*args,**args):
> self._kids=list(args)+kw.items()
>
> class Trigger(Compute):
> --- 168,174 ----
>
> class Compute(AST):
> type = 'COMPUTE'
> ! def __init__(self,*args,**kw):
> self._kids=list(args)+kw.items()
>
> class Trigger(Compute):
>
>
> Try these patches and see if it works...
>
> -steve
>
>
>
Mit freundlichen Grüßen
Joachim Schmitz
AixtraWare, Ing. Büro für Internetanwendungen
Hüsgenstr. 33a, D-52457 Aldenhoven
Telefon: +49-2464-8851, FAX: +49-2464-905163