[Zope] Problem Accessing a Z SQL Method

Asad Habib ahabib at engin.umich.edu
Fri Apr 2 08:43:09 EST 2004


Hello. I am still having a problem with this. What I don't understand is
why I am getting an error when both DTML methods involved and the Z SQL
method being called are in the same folder. In this case(by default), Zope
should be looking in this folder for the Z SQL method when the second DTML method
calls it. If the DTML method and Z SQL method were in different folders, then it
is possible to lose the context. Help from anyone would be greatly appreciated.
Thanks.

On Tue, 30 Mar 2004, David Hassalevris wrote:

> Hey Asad,
> Didnt know if someone helped you ... just a quick tip:  if you call zSql
> from a second script you may be losing your context ...
> you can try something like
> <dtml-with directory in zSql aquisition path>
>   <dtml-call yourSql>
> hth,
> David
> ----- Original Message -----
> From: "Asad Habib" <ahabib at engin.umich.edu>
> To: <zope at zope.org>
> Sent: Monday, March 29, 2004 11:56 AM
> Subject: [Zope] Problem Accessing a Z SQL Method
>
>
> > I have a DTML document that calls a DTML method which in turn calls
> > another DTML method. This second DTML method is called using the following
> > syntax:
> >
> > <dtml-call "some_dtml_method">
> >
> > Wihin this second DTML method I try to access a Z SQL method using the
> > following syntax:
> >
> > <dtml-call "update_something_sql">
> >
> > This causes Zope to flag me with an error which states the following:
> >
> > Error Type: NameError
> > Error Value: global name 'update_something_sql' is not defined
> >
> > I am fairly certain this is a namespace issue but I don't know how to
> > correct it. When I try accessing this same Z SQL method from the first
> > DTML method, everything works fine.
> >
> > Also, for your information, the DTML document, the two DTML methods, and
> > the Z SQL method are all defined on the same level.
> >
> > Any help would be greatly appreciated. Thanks.
> >
> > - Asad
> >
> > _______________________________________________
> > Zope maillist  -  Zope at zope.org
> > http://mail.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://mail.zope.org/mailman/listinfo/zope-announce
> >  http://mail.zope.org/mailman/listinfo/zope-dev )
>
>



More information about the Zope mailing list