[Zope] sorry for lame question...

Martin Gebert Murphy@members.netsolution-net.de
Sun, 26 Jan 2003 20:35:08 +0100


Corey Saltiel schrieb:

><span tal:replace="here/my_ZSql_method">
>
>
>Which provides:
>
>"<Shared.DC.ZRDB.Results.Results instance at 0x8c6df8c>"
>
>
>I don't want the instance - I want the value, of course.
>  
>
This is the object reference, and the values are, row by row, *in* this 
object. tal:replace doesn't iterate over the rows, but replaces the tag 
by the value of the object, which is this reference. Andreas has already 
answered how to use tal:repeat, so I don't go more into it...

>( My lack of Python knowhow may make the obvious less so )
>  
>
Seems so. OO programming knowledge would help, too.

>Why can't ZPT be used in other places, like ZSql methods?
>
'cause ZPT isn't designed for logic, but you need logic in Z SQL (if, 
group, and etc.).

> There is some serious
>confusion on where to use ZPT and where to use DTML.
>
Use ZPT in Page Templates, DTML in DTML-Documents, -Methods and Z SQL 
Methods. That's that.

> Why should a new user be
>required to learn *both* -- especialy when it's arguable that ZPT is more 
>"correct" ( in so far as much as better separation of logic from presentation,
>html/xml friendly, etc., etc. )
>
See above - ZPT is for design and layout, not for logic. "Better" means 
"closer to the ideal of separating content and layout" here. DTML mixes 
both and therefore is more a "write only language" (read: bad to 
administrate). In ZPT you additionally need Python for logic (which you 
needed with DTML for everything more complicated anyways...).

>I get the distinct impression from the zope-dev list that ZPT is, generaly, the 
>new desired replacement for DTML for most uses.
>  
>
You should now understand why, and in which cases. Or not...?

Martin