[Zope] How do I merge form & URL vars into sql easily
Ron Bickers
rbickers@logicetc.com
Wed, 5 Jul 2000 19:57:31 -0400
Unless I'm overlooking something here, you can just use the form variables
(e.g., <dtml-var formVarName>), whether POST or GET, in the ZSQL Method
itself. You'll need to include the variable names in the arguments list of
the ZSQL Method, but that's it.
ZSQL Methods are explained (fairly well in my opinion) in the Z SQL Methods
User's Guide at http://www.zope.org/Documentation/Guides/ZSQL-HTML/ZSQL.html
Note that if you're using Zope 2.1.6 (vs. 2.1.4 or 2.2b3) you may have
problems with this, since versions after 2.1.4 broke ZSQLMethods with regard
to names and in which order they are looked up. This made me jump from
2.1.4 straight to the 2.2 beta series, where this is fixed.
_______________________
Ron Bickers
Logic Etc, Inc.
rbickers@logicetc.com
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> asjf11@uaa.alaska.edu
> Sent: Wednesday, July 05, 2000 5:32 PM
> To: zope@zope.org
> Subject: [Zope] How do I merge form & URL vars into sql easily
>
>
> I am a new user to Zope and I'm trying to pass data that has been
> entered into a form (either through GET or POST) into another
> object. This object calls a z sql method to insert the form data into
> the database. So far, the only way I've found to pass data to the
> sql is to define arguments for it and then, in the dtml-document (or
> method) use:
> <dtml-call "REQUEST.set['argument','value']">
> (and it took me long enough to figure THAT out, let me tell you)
> The problem is that sucks when there are 30 form varibles that
> need to be inserted into the database.
> I would think that there is some way to let the sql method see
> these varibles that are defined within my document. Or loop
> through all URL or form varibles defined and sets all the vars in
> request. Something to keep from having to write the above dtml 30
> times. Thanks.
>
> Jake Feasel
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>