Trouble Creating Instance of Custom Product Programmatically
I thought I had understood the instructions at Zope.org but I'm doing something wrong. I have a custom Zope Product called PI_Clearing. It has several ZClasses in it, including one called Clearing. I want to set up a Web fom with which the user creates a new instance of a Clearing object. Following what I understand of the directions, I have this DTML method called startClearing: dtml-call "REQUEST.set('id', 'New Clearing') dtml-with "manage_addProduct['Clearing']" dtml-call "Clearing_add" /dtml-with (Angle brackets removed.) But nothing ever gets created. Clearing_add is the default add method created when I defined the Product and the Class. I've tried adding a dtml-call to set the ID of the object before calling the Clearing_add process. No luck. I get no error messages or anything, just no results. What am I not understanding?
Dan Shafer writes:
I thought I had understood the instructions at Zope.org but I'm doing something wrong.
I have a custom Zope Product called PI_Clearing. It has several ZClasses in it, including one called Clearing. I want to set up a Web fom with which the user creates a new instance of a Clearing object. Following what I understand of the directions, I have this DTML method called startClearing:
dtml-call "REQUEST.set('id', 'New Clearing') dtml-with "manage_addProduct['Clearing']" ^^^^^^^^ This need to be the product not the ZClass name. dtml-call "Clearing_add" /dtml-with
Dieter
At 08:22 PM 4/19/2002 +0200, Dieter Maurer wrote:
Dan Shafer writes:
I thought I had understood the instructions at Zope.org but I'm doing something wrong.
I have a custom Zope Product called PI_Clearing. It has several ZClasses in it, including one called Clearing. I want to set up a Web fom with which the user creates a new instance of a Clearing object. Following what I understand of the directions, I have this DTML method called startClearing:
dtml-call "REQUEST.set('id', 'New Clearing') dtml-with "manage_addProduct['Clearing']" ^^^^^^^^ This need to be the product not the ZClass name.
Thanks for the reply, Dieter. Forgot to mention that I had tried it both ways: with the ZClass name and with the Product name. No joy either way.
dtml-call "Clearing_add" /dtml-with
Dieter
Dan Shafer writes:
... Forgot to mention that I had tried it both ways: with the ZClass name and with the Product name. No joy either way.
The following may be another cause of trouble:
<dtml-call "Clearing_add"> The "..." surrounding "Clearing_add" indicate that "Clearing_add" is to be treated as a Python expression. However, in a Python expression context, a name is not automatically called (unlike when treated as a DTML name). Omit the "..." or call it explicitly with its two positional argumentes:
<dtml-call expr="Clearing_add(_.None,_)"> Read "Calling DTML objects" in <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> for details Dieter
I'm new at this I installed zope on a server at school and although for one user it seems to work fine as soon as only 6 users logged on it crashed -- we have repeated this process and it has crashed every time multiple users log on I've pasted in the log below and am seeking assistance as to the nature of the problem The log says "No space left on device" but there is 1.4 GB available on the C drive of the machine where it is installed, running under Windows 97 with 224 MB RAM any assistance would be much appreciated thank you, Bill Kerr, Woodville High School, South Australia Capture file written by TCAP 3.1, TCAP Copyright(c) 1999 Tim Kannel ------ 2002-05-01T22:53:12 INFO(0) ZServer HTTP server started at Thu May 02 08:23:12 2002 Hostname: CDSERVER Port: 8080 ------ 2002-05-01T22:53:12 INFO(0) ZServer FTP server started at Thu May 02 08:23:12 2002 Hostname: cdserver Port: 8021 ------ 2002-05-01T22:53:12 INFO(0) ZServer PCGI Server started at Thu May 02 08:23:12 2002 Inet socket port: 8090 ------ 2002-05-02T01:04:38 ERROR(200) ZServer uncaptured python exception, closing channel <zhttp_channel connected 10.60.184.196:1045 at 156765c channel#: 30 requests:> (exceptions.IOError:[Errno 28] No space left on device [C:\Program Files\ZopeWeb\bin\lib\asyncore.py|poll|107] [C:\Program Files\ZopeWeb\bin\lib\asyncore.py|handle_write_event|390] [C:\Program Files\ZopeWeb\ZServer\medusa\asynchat.py|handle_write|147] [C:\Program Files\ZopeWeb\ZServer\medusa\asynchat.py|initiate_send|209] [C:\Program Files\ZopeWeb\ZServer\medusa\asynchat.py|refill_buffer|196] [C:\Program Files\ZopeWeb\ZServer\Producers.py|more|108] [C:\Program Files\ZopeWeb\ZServer\medusa\http_server.py|log|289] [C:\Program Files\ZopeWeb\ZServer\medusa\logger.py|log|247] [C:\Program Files\ZopeWeb\ZServer\medusa\logger.py|log|77] [C:\Program Files\ZopeWeb\ZServer\medusa\logger.py|write|53] [C:\Program Files\ZopeWeb\ZServer\medusa\logger.py|maybe_flush|65]) Traceback (most recent call last): File "C:\Program Files\ZopeWeb\z2.py", line 774, in ? asyncore.loop() File "C:\Program Files\ZopeWeb\bin\lib\asyncore.py", line 194, in loop poll_fun (timeout, map) File "C:\Program Files\ZopeWeb\bin\lib\asyncore.py", line 111, in poll obj.handle_error() File "C:\Program Files\ZopeWeb\ZServer\medusa\http_server.py", line 437, in handle_error asynchat.async_chat.handle_error (self) File "C:\Program Files\ZopeWeb\bin\lib\asyncore.py", line 413, in handle_error self.close() File "C:\Program Files\ZopeWeb\ZServer\HTTPServer.py", line 369, in close p.more() # free up resources held by producer File "C:\Program Files\ZopeWeb\ZServer\Producers.py", line 108, in more getattr(self.logger, self.method)(self.bytes) File "C:\Program Files\ZopeWeb\ZServer\medusa\http_server.py", line 289, in log ' - %s [%s] "%s" %d %d "%s" "%s"\n' % ( File "C:\Program Files\ZopeWeb\ZServer\medusa\logger.py", line 247, in log self.logger.log ('%s%s' % (ip, message)) File "C:\Program Files\ZopeWeb\ZServer\medusa\logger.py", line 77, in log self.write (message) File "C:\Program Files\ZopeWeb\ZServer\medusa\logger.py", line 53, in write self.maybe_flush() File "C:\Program Files\ZopeWeb\ZServer\medusa\logger.py", line 65, in maybe_flush self.file.flush() IOError: [Errno 28] No space left on device
Have a look at the size of your var/Z2.log file... On Windows 98, it cannot go beyond 2Gb AFAIK. HTH --Gilles Lenfant ----- Original Message ----- From: "Bill Kerr" <kerrb@senet.com.au> To: <zope@zope.org> Cc: "Paul Trezise" <pault@pobox.com> Sent: Wednesday, May 01, 2002 9:35 PM Subject: [Zope] zope server crashing : I'm new at this [...]
Bill Kerr writes:
... 2002-05-02T01:04:38 ERROR(200) ZServer uncaptured python exception, closing channel <zhttp_channel connected 10.60.184.196:1045 at 156765c channel#: 30 requests:> (exceptions.IOError:[Errno 28] No space left on device ... Files\ZopeWeb\ZServer\medusa\logger.py|log|77] [C:\Program Files\ZopeWeb\ZServer\medusa\logger.py|write|53] [C:\Program Files\ZopeWeb\ZServer\medusa\logger.py|maybe_flush|65])
The error message is completely clear: Zope tries to write a log entry (usually to "<zopedir>\var\Z2.log") and you operating system returns an error "no space left on device". Up to you to determine why your operating system does this. The most expected answer would be: there is no space on this partition... Dieter
participants (4)
-
Bill Kerr -
Dan Shafer -
Dieter Maurer -
Gilles Lenfant