[Zope-DB] Using <dtml-var>s in ZSQL methods?

Ken Winter ken at sunward.org
Mon Jun 18 11:37:29 EDT 2007


> -----Original Message-----
> From: Maciej Wisniowski [mailto:maciej.wisniowski at coig.katowice.pl]
> Sent: Monday, June 18, 2007 1:34 AM
> To: Ken Winter
> Cc: 'Zope-DB List'
> Subject: Re: [Zope-DB] Using <dtml-var>s in ZSQL methods?
> 
> 
> > I tried to invoke the "query" method of my adapter (which is named
> > "dhatabase") with this code:
> >
> > "
> > p = context.REQUEST.get('delete_this')
> > if p:
> >     s = ', '.join([str(x) for x in p])
> >     t = "delete from person where person_id in (%s);" % s
> >     context.dhatabase.query(query_string=t)
> > "
> >
> > ...and got this error: "AttributeError: query" (full traceback at end of
> > message).  What's wrong with my method call?
> >
> Try:
> 
>     context.dhatabase().query(query_string=t)
> 
> Assuming that 'dhatabase' is your DatabaseConnection object.

Thanks, Maciej.  That works fine!

~ Ken



More information about the Zope-DB mailing list