RE: Using <dtml-var>s in ZSQL methods?
"Ken Winter" <[email protected]> Mon, 18 Jun 2007 11:37:29 -0400
| Newsgroups | gmane.comp.web.zope.database |
|---|---|
| Message-ID | <000901c7b1be$95444390$6703a8c0@KenIBM> |
> -----Original Message----- > From: Maciej Wisniowski [mailto:[email protected]] > 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