[Zope] - Help inserting into MySQL
Chad Fowler
cfowler@fedex.com
27 Dec 1998 07:09:35 -0000
I've been trying to make a simple application that posts news onto a news page (ala Slashdot or whatever) and then displays it dynamically. I have gotten the display pages to work fine, but I'm having trouble with the Insert page.
When I fill out my form, and insert my data, the data actually gets inserted as intended, but I get a "Zope Unavailable" error with the following traceback:
Traceback (innermost last):
File /home/brian/temp/build/tmp_build/Zope-1.9.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 879, in publish_module
File /home/brian/temp/build/tmp_build/Zope-1.9.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 595, in publish
(Info: /pootybbs/newsadder)
File /home/brian/temp/build/tmp_build/Zope-1.9.0-linux2-x86/lib/python/OFS/Document.py, line 181, in __call__
(Object: newsadder)
File /home/brian/temp/build/tmp_build/Zope-1.9.0-linux2-x86/lib/python/OFS/Document.py, line 177, in __call__
(Object: newsadder)
File /home/brian/temp/build/tmp_build/Zope-1.9.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 514, in __call__
(Object: newsadder)
File /home/brian/temp/build/tmp_build/Zope-1.9.0-linux2-x86/lib/python/DocumentTemplate/DT_Util.py, line 268, in eval
(Object: insertnews(sub=submitter, cat=category, tit=titl, bod=body))
File <string>, line 0, in ?
File /home/brian/temp/build/tmp_build/Zope-1.9.0-linux2-x86/lib/python/Shared/DC/ZRDB/DA.py, line 402, in __call__
(Object: Item)
File /projects/build/ZMySQLDA-1.1.0-nonbin/lib/python/Products/ZMySQLDA/db.py, line 178, in query
NameError: (see above)
How I'm doing the insert:
I have a form with four fields (submitter, category, title, body). When you submit, it does
"<!--#call "insertnews(sub=submitter, cat=category, tit=titl, bod=body)"-->
<!--#var news-->"
The "news" object is the same page that displays the news. "insertnews" is a Z SQL method that accepts four arguments (shown above). It also inserts the current timestamp (using PrincipiaTime).
So, what silly (and wrong) thing could I have done to cause this error?
Thanks for any help. So far, this list has been exceptionally friendly and helpful.
Thanks,
Chad Fowler
(cfowler@fedex.com)