[Zope] Re: [Zope-dev] sql-statements in DTML-Methods....

Chris McDonough chrism@digicool.com
Sun, 18 Jun 2000 20:47:05 -0400


Zope differs from PHP and ASP systems in this regard.  I don't think
anyone using Zope that I've seen inlines SQL inside DTML.    The
separation of SQL and presentation via DTML is intentional.  Though it's
not always as expedient, the intent of the separation is to provide you
with layers of abstraction that make it easier to maintain and modify
your code later.

That said, I imagine you could do it by constructing a string inside
DTML that has the sql query and passing it in to a dummy SQL method that
performs the query and returns the results.

Marc LUDWIG wrote:

> My question is now:
> 
> Do I have to define one Z SQL Method for every SQL statement I want to
> perform on my database or is it possible to define SQL-statements and
> database requests in my DTML-method?
> 
> Am I missing something? Any idea? Thanks a lot.