Q/ regarding 'Broken Product'
Hi there; stumbling over a $§#@ issue, a few questions arose regarding Products: I'm happily zopeing away my time while trying to implement a simple Product; this is group of a keyword-indexed list of incidents; one could easily think of it as some kind of support system. I started to implement this as 3 python classes, namely the group, the keyword and the incident class; the group objects are added via selection list and Add button, so they have Zope-ID's. They contain lists of keyword and incident object instances, with the keyword and incident objects having their own reference lists. All my objects are created persistent. Problems: ======================= Whenever there's a "severe" error (like a syntax error in the Product python code), I see a 'broken Product'. Sometimes I'm able to fix the error and to then reuse my created Product instances and all its subsidiary objects. Sometimes the Product instance will have ceased to exist, which is quite a P.I.T.A. Nevertheless, the Product keeps on showing up as 'Broken', including its out-dated Traceback, until I "delete" it and restart Zope. Q#1: How can I 'mend' a broken Product w/o deleting it? Q#2: How can I avoid the grim reaping of its instances upon tiny errors like a missed out ')' ? Q#3: When I change attributes of e.g. an anonymous keyword object: will this inevitably result in the often_heard_of database inflation 'til next pack day? Flame bait: Q#4: Am I doing The Right Thing (creating 'anonymous' objects), or would a Zopeing One Perfectly Enlightened choose to e.g. create tons of directly accessible objects like 'ID=keyw_adaptec_scsi_controller' or 'ID=incident_1999_05_03_17_42_05_923' ? Currently I'm quite happy using methods mapping object identifiers to objects (like <!--#with "get_kw('scsi_controller')"-->) and then accessing their attributes 1K TIA tom (in heavy reconsideration mode right before the final coding) =========== MfG: Thomas Riedl =========================================================================== triedl@linuxland.de, (+49 89) 99 34 12 - 11, http://www.linuxland.de Stefan-George-Ring 24, 81929 München
Thomas Riedl wrote:
Hi there;
stumbling over a $§#@ issue, a few questions arose regarding Products:
I'm happily zopeing away my time while trying to implement a simple Product; this is group of a keyword-indexed list of incidents; one could easily think of it as some kind of support system.
I started to implement this as 3 python classes, namely the group, the keyword and the incident class; the group objects are added via selection list and Add button, so they have Zope-ID's.
They contain lists of keyword and incident object instances, with the keyword and incident objects having their own reference lists. All my objects are created persistent.
Problems: ======================= Whenever there's a "severe" error (like a syntax error in the Product python code), I see a 'broken Product'.
Sometimes I'm able to fix the error and to then reuse my created Product instances and all its subsidiary objects.
Sometimes the Product instance will have ceased to exist, which is quite a P.I.T.A.
I've never seen this. It would be interesting to use the bbb.py script in the utilities directory (of Zope 2.0a1 or in the public CVS) to create an XML rendition of your database. This might give you a better idea where your data has gone. :) Uh, what exactly do you mean by ceased to exist? What is your evidence for this? Do they no longer show up in otherwise functioning folders?
Nevertheless, the Product keeps on showing up as 'Broken', including its out-dated Traceback, until I "delete" it and restart Zope.
What version of Zope are you using? I thought 1.10.2 got this right.
Q#1: How can I 'mend' a broken Product w/o deleting it?
You *should* be able to just mend it. If it doesn't show up as mended, then there is a Zope bug.
Q#2: How can I avoid the grim reaping of its instances upon tiny errors like a missed out ')' ?
If this is happening, then there is almost certainly some sort of Zope bug. See if you get any ideas about what's going on by looking at the XML.
Q#3: When I change attributes of e.g. an anonymous keyword object: will this inevitably result in the often_heard_of database inflation 'til next pack day?
I'm not sure what you are refering to here. When you change any (persistent) object, a new version of the object is written to the database. The old version is retained until it is packed.
Flame bait: Q#4: Am I doing The Right Thing (creating 'anonymous' objects), or would a Zopeing One Perfectly Enlightened choose to e.g. create tons of directly accessible objects like 'ID=keyw_adaptec_scsi_controller' or 'ID=incident_1999_05_03_17_42_05_923' ?
Zope has *lots* of persisent objects that are not directly web addressable. This is not a problem at all.
Currently I'm quite happy using methods mapping object identifiers to objects (like <!--#with "get_kw('scsi_controller')"-->) and then accessing their attributes
That's fine. There are lots of Zope objects that work that way. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (540) 371-6909 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (2)
-
Jim Fulton -
Thomas Riedl