[Zope] Name Errors: DTML Document -> External Python Document -> DTML Document -> ZSQL cument -> ZSQL
I have an SQL database that I want to populate using an external Python method (because I have file I/O code). So I have something like this: DTML Document named import_file which has: parsefile is my external Python method. def parsefile (self): # blah, blah self.record_info (arg1=value1,arg2=value2) record_info is a DTML document { random code here } And LookupPrinter is a ZSQL Method So I have: DTML Document -> External Python Document -> DTML Document -> ZSQL Document Is this a sane thing to have my External Python Document calling back to DTML Documents? I keep getting name error on the LookupPrinter. I tried putting: and I still get the name error. In essence I am trying to have code that will parse a file and then record the results in my database. Thanks. Becky. ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Form variables with same name as folder names
>On Tue, 14 Nov 2000, "Burwell, Becky wrote: >> This working UNTIL I created a Folder named FOO. Then the >value of FOO in >> the Z SQL method seemed to be the FOO folder and not FOO >from REQUEST. My >> workaround was to call the variable FOOCHECKBOX. >> >> >> 2) is there some way I could have referred to the variable >FOO in my Z SQL >> method without resorting to renaming the variable in my form? >> > >A sneaky problem indeed, and once again, one caused by "convenient" >shortcuts. (o8 > >The simple answer: use REQUEST.form['FOO'] to refer to the >form variable. I just did an experiment and if I do the following my SQL Method: this is never true. If I do: or I get name errors with REQUEST being unknown. The REQUEST.form thing works in the DTML document that calls the SQL method but not in the SQL method itself. *becky* ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] Form variables with same name as folder names
Hi. I am new to using Zope and just got stuck on the following problem. I am trying to use forms with an SQL database. I have a form with checkboxes and I use variables like FOO to capture the value. For example: The form has a post with the action to call a DTML document. In my DTML document I call a Z SQL Method called InsertMethod with REQUEST as the argument, for example InsertMethod(REQUEST). My Z SQL Method InsertMethod has arguments including FOO="" And then in the body of the Z SQL method I have: {code to insert into a database table} This working UNTIL I created a Folder named FOO. Then the value of FOO in the Z SQL method seemed to be the FOO folder and not FOO from REQUEST. My workaround was to call the variable FOOCHECKBOX. Two questions: 1) the ZSQL manual, http://www.zope.org/Documentation/Guides/ZSQL-HTML/ZSQL.1.4.4.html, says that the first lookup should be variables in HTTP_REQUEST. So why is FOO referring to my folder FOO? 2) is there some way I could have referred to the variable FOO in my Z SQL method without resorting to renaming the variable in my form? Thanks! *becky* ___ Zope maillist - [EMAIL PROTECTED] 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 )