[ZPT] Confused about Zope
Chris Withers
chrisw@nipltd.com
Wed, 05 Mar 2003 12:29:43 +0000
Evan Simpson wrote:
>
>> The idea I was going on, though, is to *avoid* breaking from TAL--I
>> wanted people to learn TAL then reuse those skills for non-XML.
>
> I suggest that TAL (as opposed to TALES) is so *small* that there is
> very little knowledge there worth transferring to another domain.
I beg to differ. Especially when they have to learn an alternative to TAL for a
specific need that ends up being a whole new language like PTL.
> A great deal of the unpleasantness
> of templated SQL has to do with things like lists that don't tolerate
> trailing commas (despite mandatory surrounding parens), separate but
> coordinated lists of names and values (INSERT), and keywords such as
> 'where' that should only appear if their "section" is non-empty.
I hypothesise that these can all eb taken care of with the Zope 3 API stuff as
well. What's the best way to test that hypothesis?
> I start thinking along these lines:
>
> s = Delete("addresses")
> s.where = w = Where()
> if state:
> w.add(Field("state"), "=", Value(state))
> if zip:
> w.add(Field("postcode"), "=", Value(zip))
> if w:
> w.add(Or(Not(Field("current")),
> (Field("status"), "containing", Value("x")))
>
> ...but I quickly get discouraged by the verbosity and complexity that
> seems to be required to do it correctly.
Indeed, Yuk II ;-)
chairs,
Chris