RE: [Zope] Writing to SQL Databases
-----Original Message----- From: Ross J. Reedstrom [mailto:reedstrm@wallace.ece.rice.edu] Sent: Monday, July 19, 1999 2:07 PM To: Sean McMains Cc: 'zope@zope.org' Subject: Re: [Zope] Writing to SQL Databases
<!--#call addEntry(REQUEST)-->
This will work if quoted.
or perhaps
<!--#call addEntry(REQUEST=REQUEST)-->
This will not work, a) because it's not quoted and b) because ZSQL methods *do* expect the data structure DTML calls 'REQUEST' but ZSQL methods call it 'request'. Although many Zope method signatures contain 'REQUEST', some contain 'request' or 'req' but expect the same data structure. This is the danger Zone when using keyword argument. In the case of ZSQL methods, it's 'request=REQUEST'. It would probably be best to stick with your first example, quoted. -Michel
should do it.
Ross -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Sorry for the near miss everyone. I _did_ go look at a working ZSQL query I have, and thought I translated it into Sean's case correctly, but something still looked wrong... Those dang quotes can be so invisible (but important) sometimes! I overgeneralized the case of using #call for calling DTMLMethods, I think. (You do need to pass the REQUEST in that case as well, right?) Ross P.S. thanks for the catch, Michel. I _hate_ spreading disinformation, but noone had answered Sean, and it seemed so simple... On Mon, Jul 19, 1999 at 05:19:48PM -0400, Michel Pelletier wrote:
<!--#call addEntry(REQUEST)-->
This will work if quoted.
or perhaps
<!--#call addEntry(REQUEST=REQUEST)-->
This will not work, a) because it's not quoted and b) because ZSQL methods *do* expect the data structure DTML calls 'REQUEST' but ZSQL methods call it 'request'. Although many Zope method signatures contain 'REQUEST', some contain 'request' or 'req' but expect the same data structure. This is the danger Zone when using keyword argument. In the case of ZSQL methods, it's 'request=REQUEST'. It would probably be best to stick with your first example, quoted.
-Michel
-- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
participants (2)
-
Michel Pelletier -
Ross J. Reedstrom