Hello Zope and MySQL users, I'm trying to access MySQL through Zope. I hope someone can point out my set-up error(s). Environment: Windows98: 4.10.98 MySQL Server: 3.23.21-beta-debug Zope v.: 2.2.0 (binary release, python 1.5.2, win32-x86) Python v.: 1.5.2 (#0, Jul 30 1999, 09:52:18) [MSC 32 bit (Intel)] ZMySQLDA v.: 1.1.4 (nonbinary) (in: <zope-dir>/lib/Products/ZMySQLDA/) MySQL.pyd 'MySQLmodule-1.4: A Python interface to the MySQL database.' (this from MySQL.__doc__) (in: <zope-dir>/bin/lib/) MySQL works fine through the mysqlc monitor and Python scripts using odi and odbc. But I keep crashing Zope/Python with even the simplest queries. Here's what I do, followed by the mysqld -log file entries. Start MySQL: C:\mysql\bin\mysqld.exe --console --log Start Zope: C:\Program Files\<zope-dir>\start.bat (Which is, out-of-the-box: "C:\Program Files\TotipotentZope\bin\python.exe" "C:\Program Files\TotipotentZope\z2.py" -D %1 %2 %3 %4 %5 %6 %7 %8 %9) Zope says: 2000-08-10T11:44:08 PROBLEM(100) ZServer Computing default hostname ------ 2000-08-10T11:44:08 INFO(0) ZServer Medusa (V1.16.4.2) started at Thu Aug 10 13:44:08 2000 Hostname: LAP_WILL Port:8080 (Other than PROBLEM(100), all looks fine.) Start Netscape (Communicator 4.7 -- but same results with IE5) Go to: http://localhost:8080/manage; login Go to: folder with 'Z MySQL Database Connection' Open: Database Connection object> 'The database connection is open.' Go to: 'Properties' click 'Change' (without changing anything) Crash: 'PYTHON caused an invalid page fault in module MYSQL.PYD at 015f:012d3827.' MySQL log files (tmm is a DB on MySQL): C:\mysql\bin\mysqld.exe, Version: 3.23.21-beta-debug-log, started with: Tcp port: 3306 Unix socket: MySQL Time Id Command Argument 000810 13:56:23 1 Connect root@localhost on 1 Init DB tmm 000810 13:56:35 2 Connect root@localhost on 2 Init DB tmm 1 Quit Many thanks for any suggestions. William BC Crandall Wiesbaden, Germany wcra@beest.midat.de
Just starting to set things up, and I would like a standard_html_footer with a date-stamp. As a start, I tried: <hr> <p>Last modified: <dtml-var name="date" fmt="aCommonZ"></p> <p><dtml-var ZopeAttributionButton></p> </body> </html> Why does this break? Minimal format breaks in the same way: <hr> <p>Last modified: <dtml-var date fmt=aCommonZ></p> <p><dtml-var ZopeAttributionButton></p> </body> </html> In either case, View generates: Zope Error Zope has encountered an error while publishing this resource. KeyError Sorry, a Zope error occurred. Traceback (innermost last): File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 222, in publish_module File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\Program Files\TotipotentZope\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 171, in publish File C:\Program Files\TotipotentZope\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\OFS\DTMLMethod.py, line 167, in __call__ (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\DocumentTemplate\DT_Var.py, line 276, in render (Object: date) KeyError: date
<dtml-var bobobase_modification_time> should do what you are after. <dtml-var bobobase_modification_time fmt="%H:%M"> Should return 15:35 for example. Take a look at http://www.zope.org/Members/AlexR/CustomDateFormats for date and time formats. I've had som problems with returning the modification date of the right object if you do like this in standrard_html_footer Use: <dtml-with "_.string.split(URL,'/')[-1]"> Current page last modfified: <dtml-var bobobase_modification_time> </dtml-with> This should maybe be coupled together with a dtml-try or simply dtml-if, but I haven't run into problems with it without.
Just starting to set things up, and I would like a standard_html_footer with a date-stamp.
As a start, I tried:
<hr> <p>Last modified: <dtml-var name="date" fmt="aCommonZ"></p> <p><dtml-var ZopeAttributionButton></p> </body> </html>
Why does this break? Minimal format breaks in the same way:
<hr> <p>Last modified: <dtml-var date fmt=aCommonZ></p> <p><dtml-var ZopeAttributionButton></p> </body> </html>
In either case, View generates:
Zope Error Zope has encountered an error while publishing this resource.
KeyError
Sorry, a Zope error occurred.
Traceback (innermost last): File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 222, in publish_module File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\Program Files\TotipotentZope\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 171, in publish File C:\Program Files\TotipotentZope\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\OFS\DTMLMethod.py, line 167, in __call__ (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: standard_html_footer) File C:\Program Files\TotipotentZope\lib\python\DocumentTemplate\DT_Var.py, line 276, in render (Object: date) KeyError: date
_______________________________________________ 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 )
Hi, William BC Crandall wrote:
Just starting to set things up, and I would like a standard_html_footer with a date-stamp.
As a start, I tried:
<hr> <p>Last modified: <dtml-var name="date" fmt="aCommonZ"></p> <p><dtml-var ZopeAttributionButton></p> </body> </html>
Why does this break? Minimal format breaks in the same way:
<hr> <p>Last modified: <dtml-var date fmt=aCommonZ></p> <p><dtml-var ZopeAttributionButton></p> </body> </html>
If you want the date the document was last modified, then you have to use <dtml-var bobobase_modification_time> or <dtml-var bobobase_modification_time fmt=aCommonZ> . If this is in standard_html_footer and standard_html_footer is a dtml-method, then you should probably use <dtml-with "this"> <dtml-var bobobase_modification_time fmt=aCommonZ> </dtml-with> ... Holger
Holger, Peter, and Luis, Thanks for your emails. This: <dtml-with "this"> <dtml-var bobobase_modification_time fmt=aCommonZ> </dtml-with> gave me what I was looking for. "http://www.zope.org/Members/AlexR/CustomDateFormats" Was also a good pointer. For those into historical trivia, what or who is "bobo"? Regards,
William BC Crandall wrote:
For those into historical trivia, what or who is "bobo"?
A nice bit of history: ;-) http://www.zope.org/Members/paul/BusinessDecision cheers, Chris
Hello Chris, Thanks for the historical pointer. Also explains why 'Add Z Gadfly Database Connection' pops up a strange sounding comment for new Zopers: Additional data sources may be created by making additional directories in the var/gadfly subdirectory of your Principia installation. ^^^^^^^^^ Another question of 'Zope Culture': Is the anti Win98 feeling I get an accurate assessment of the Zopista community? I've been having more than a little difficulty installing MySQL-Zope tools on Win98 ('ZMySQLDA on Win32'). Only one person (Phil Harris) has been willing to answer questions. But the mailing list, by volume and quality, gives clear evidence of an active and intelligent Zope community. Andy Dustman's documentation for what seems like a nice MySQL interface puts it clearly: <P>Windows is <EM>not</EM> a supported platform. I currently function in two worlds, Win98 and Linux. Would I be right to say that 90% of Zopers live in world number two? Regards,
William BC Crandall wrote:
Thanks for the historical pointer.
Read the QuickStart if you really want to dig up some archane terms ;-) (Acquaduct, Bobo, Principia, etc)
Another question of 'Zope Culture': Is the anti Win98 feeling I get an accurate assessment of the Zopista community?
Not so much the Zope community as anyone who runs servers IMHO :S
I've been having more than a little difficulty installing MySQL-Zope tools on Win98 ('ZMySQLDA on Win32'). Only one person (Phil Harris) has been willing to answer questions.
Maybe he's tried it, I know i haven't...
But the mailing list, by volume and quality, gives clear evidence of an active and intelligent Zope community.
Thanks, on their behalf ;-)
I currently function in two worlds, Win98 and Linux. Would I be right to say that 90% of Zopers live in world number two?
I dunno. Lots of Linux yes, but a lot of other *nix too and at least a proportion of WinNT and 2K. cheers, Chris
I currently function in two worlds, Win98 and Linux. Would I be right to say that 90% of Zopers live in world number two?
I dunno. Lots of Linux yes, but a lot of other *nix too and at least a proportion of WinNT and 2K.
Why not set up a Poll on zope.org to find out about these things. Like a weekly poll. Here - DC - are some other questions I can consider to participate in: - What platform do you use for your Zope? - Do you use Apache (ZAP) infront of your Zserver? - Are you subscribing to the mailing list? - Do you check the mailing list archive before you post to the mailninglist? - Are you webmaster of the server you run Zope on? - - This would also make people go back to zope.org more often, and all its benefits. Count me in for help!
On Mon, 14 Aug 2000 15:43:25 +0200, William BC Crandall <wcra@beest.midat.de> wrote:
Another question of 'Zope Culture': Is the anti Win98 feeling I get an accurate assessment of the Zopista community?
Andy Dustman's documentation for what seems like a nice MySQL interface puts it clearly:
<P>Windows is <EM>not</EM> a supported platform.
I currently function in two worlds, Win98 and Linux. Would I be right to say that 90% of Zopers live in world number two?
Most of Zope (and python in general) is shockingly platform-neutral. It sounds like the same might not be true of MySQL. Toby Dickenson tdickenson@geminidataloggers.com
On Mon, 14 Aug 2000, William BC Crandall wrote:
Andy Dustman's documentation for what seems like a nice MySQL interface puts it clearly:
<P>Windows is <EM>not</EM> a supported platform.
Yeah, that's just me. I don't support Windows in any way. However, MySQLdb does work there, so I am told. If you can't get it to compile or something, I can't help you. -- andy dustman | programmer/analyst | comstar.net, inc. telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d "Therefore, sweet knights, if you may doubt your strength or courage, come no further, for death awaits you all, with nasty, big, pointy teeth!"
participants (6)
-
Andy Dustman -
Chris Withers -
Holger Hoffmann -
Peter Bengtsson -
Toby Dickenson -
William BC Crandall