Re: [Zope-dev] Python Product as DataSkin
Michael R. Bernstein wrote: > > Hmm. I thought I was doing it wrong. Here is the error and traceback > from trying to instantiate the modified Product (through the > standard mgmt interface): > > This resource may be trying to reference a nonexistent object or > variable _v_dm_ > Any ideas? Is the __init__ method of DataSkin getting called? This would happen if, for example, you define an __init__ method in your class, but you don't use something like: from Globals import default__class_init__ default__class_init__(yourClass) (At least, I *think* that's one of the things that default__class_init__ does. Otherwise, you'll need to make sure you call DataSkin.__init__ from your __init__ method, probably using Acquisition.inheritedAttribute.) -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ConflictErrors and how to handle them
Hi guys, I've been struggling with a problem, namely ConflictErrors. At times, a long-running process may add 100, 1000, 1 objects to a single folder. Under this process, several ConflictErrors may be raised, but they are captured, and the transaction committed again. Problem solved. However, the other side of the problem is that regular requests, from other users, may be be aborted, and as a result the user is presented with a Zope Error screen, which says ConflictError. If I've understood this correctly, it is because the ZODB connection is hosed, and innocent reads trigger ConflictErrors. So, I'm wondering about turning up the number of Exceptions each request may handle (it's 3 now, right?) and just hope that the exception isn't raised more than 10-20 times. Where can I increase the number of accepted exceptions per request? Any thoughts on the solution itself? Cheers, Morten ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns and SQL
Hi there! I have a little problem with my Specialist and DataSkins regarding storage inside an sql database. Mainly I don't know what to put under the "loading by accessing attribute" in the Storage tab of the Rack. I have the following SkinScript: WITH QUERY getCustomer(customer_id=self.id) COMPUTE company_name, customer_no WHEN OBJECT ADDED CALL addCustomer( company_name=self.company_name, customer_no=self.customer_no ) WHEN OBJECT CHANGED STORE company_name,customer_no USING updateCustomer(customer_id=self.id, company_name=self.company_name, customer_no=self.customer_no ) I've now set the loadAttrib to "company_name" and retrieving objects works fine. Unfortunately when doing a newItem() with some random new id (it's not used as the database should provide the id) I get an error that this id already exists. Of course I've checked it in the database and it's not there. After some code reading I found in retrieveItem: a = self.loadAttrib item = None if a: item = self._RawItem(key) if hasattr(item.aq_base, a): return item So as the item is an instance of my ZClass containing also an company_name attribute it will always return the item and because of that the Rack thinks it's already there. So why is this happening? What do I need to change? When changing the loadAttrib to something else (non existing), the newItem is working but instead getItem is not working anymore as it returns None only.. (somehow the zsql method is not even called thus the skinscript seems not to work in that case (I guess because the loadAttrib is not defined in it somewhere)). Does anybody know any help? (somehow I once had a working specialist with an sql table but I dunno what happened to make it not work anymore). My ZPatterns version is the one of stevea and my Zope is 2.3 kind regards, Christian -- COM.lounge http://comlounge.net/ communication & design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Python Product as DataSkin
Steve Alexander wrote: > > Is the __init__ method of DataSkin getting called? > > This would happen if, for example, you define an __init__ method in your > class, but you don't use something like: > > from Globals import default__class_init__ > > default__class_init__(yourClass) > > (At least, I *think* that's one of the things that default__class_init__ > does. Otherwise, you'll need to make sure you call DataSkin.__init__ > from your __init__ method, probably using Acquisition.inheritedAttribute.) This sounds like it's on the right track because I *am* defining an __init__ method, and I don't have any code resembling what you typed. Where do I put this again? Does this go in the myclass.py file or the products __init__.py file? And where in the file does the code in the second line get used exactly? Sorry for being a little dense, Michael Bernstein ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] how to create third party Product?
Huayin wang wrote: > > It would be great if someone can tell me how to create > a third party product in 1) dtml, 2) python method. > Does it depend on whether the product is a ZClass > product? > > Where's the documentation that I can read to get a > clue? > > thanks! > Check out: http://www.zope.org/Documentation/Guides/ZDG-HTML/ZDG.html http://www.zope.org/Members/kedai/BuildSimpleZClass http://www.zope.org/Members/AlexR/CatalogAware http://www.zope.org/Members/maxm/HowTo/minimal_01 http://www.zope.org/Members/gtk/Boring/HowTo-Boring -- | Casey Duncan | Kaivo, Inc. | [EMAIL PROTECTED] `--> ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Refresh vs Python Scripts
Do these two play nicely together? cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Refresh vs Python Scripts
Chris Withers wrote: > > Do these two play nicely together? If you mean to refresh the Python Scripts product, I don't know of a reason why that wouldn't work. I just tried it and it seems to be fine. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Python Product as DataSkin
"Phillip J. Eby" wrote: > > At 10:47 PM 2/18/01 -0800, Michael R. Bernstein wrote: > > > >Hmm. So I need to refactor the 'manage_add' method inside > >the python product into two methods, 'manage_add' which > >would be used by the 'normal' object creation process and > >that would also call a second 'setup' method which could be > >called by the specialists 'myadd' method directly, bypassing > >the 'manage_add' method entirely. > > > >Is that correct? > > Pretty much Ok, but in that case a simple should at least execute without error, and it doesn't: Error Type: TypeError Error Value: not enough arguments; expected 4, got 2 Traceback (innermost last): File /usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope-2.2.0-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: ProviderContainer) File /usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope-2.2.0-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: addArchiveImage) File /usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: addArchiveImage) File /usr/local/Zope-2.2.0-src/lib/python/OFS/DTMLMethod.py, line 167, in __call__ (Object: addArchiveImage) File /usr/local/Zope-2.2.0-src/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: addArchiveImage) File /usr/local/Zope-2.2.0-src/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval (Object: newItem(REQUEST.id)) (Info: newItem) File, line 0, in ? File /home/webmaven/Products/ZPatterns/Specialists.py, line 40, in newItem (Object: ProviderContainer) File /home/webmaven/Products/ZPatterns/Rack.py, line 73, in newItem (Object: ProviderContainer) File /home/webmaven/Products/ZPatterns/Rack.py, line 135, in createItem (Object: ProviderContainer) File /home/webmaven/Products/ZPatterns/Rack.py, line 232, in _RawItem (Object: ProviderContainer) TypeError: (see above) What am I doing wrong? Michael Bernstein. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Refresh vs Python Scripts
Shane Hathaway wrote: > > Chris Withers wrote: > > > > Do these two play nicely together? > > If you mean to refresh the Python Scripts product, I don't know of a > reason why that wouldn't work. I just tried it and it seems to be fine. Cool, must have been something else :-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Waaagh! Python Script won't allow __setitem__
Hi, I've got an object which implements __setitem__ in such a way that it's perfectly safe for use in Python Scripts. Sadly, it seems that Evan's Byte Code hacks won't let me do this :-( Whenever I try to do something like: myobject['fish']=1, I get a traceback like the following: Traceback (innermost last): File E:\Zope\237994~1.0\lib\python\Shared\DC\Scripts\Bindings.py, line 324, in __call__ (Object: ThePythonScript) File E:\Zope\237994~1.0\lib\python\Shared\DC\Scripts\Bindings.py, line 353, in _bindAndExec (Object: ThePythonScript) File E:\Zope\237994~1.0\lib\python\Products\PythonScripts\PythonScript.py, line 330, in _exec (Object: ThePythonScript) (Info: ({'script': , 'container': , 'traverse_subpath': [], 'context': }, ({},), {}, None)) File Script (Python), line 6, in ThePythonScript File E:\Zope\237994~1.0\lib\python\Products\PythonScripts\zbytecodehacks\VSExec.py, line 429, in __setitem__ TypeError: (see above) Is there any way I can get around this other than renaming __setitem__ to set, which screws up the nice python syntax? cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and SQL
At 02:59 PM 2/19/01 +0100, Christian Scholz wrote: > >So as the item is an instance of my ZClass containing also an company_name attribute >it will always return the item and because of that the Rack thinks it's already there. >So why is this happening? What do I need to change? You need to use an attribute which the object has *if and only if* it exists in the database. If the class has the attribute defined, all instances exist, and you can't even load it with SkinScript because ZPatterns uses __getattr__ to redefine attributes, and that doesn't work if the attribute already exists in the class. >When changing the loadAttrib to something else (non existing), the newItem is working >but instead getItem is not working anymore as it returns None only.. (somehow the zsql >method is not even called thus the skinscript seems not to work in that case (I guess >because the loadAttrib is not defined in it somewhere)). Right. The load attribute has to be one defined in a provider, and which will end up being "NOT_FOUND" if the object doesn't exist in the table you're querying. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] More PythonScript woe :-(
If I try and do: if type(x) == type(0): ...I get a NameError on type :-( What is so bad about type that I can't use it safely in PythonScripts?!? frustratedly, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and SQL
Hi! > >So as the item is an instance of my ZClass containing also an company_name > attribute > >it will always return the item and because of that the Rack thinks it's > already there. > >So why is this happening? What do I need to change? > > You need to use an attribute which the object has *if and only if* it > exists in the database. If the class has the attribute defined, all > instances exist, and you can't even load it with SkinScript because > ZPatterns uses __getattr__ to redefine attributes, and that doesn't work if > the attribute already exists in the class. So I shouldn't define it inside the ZClass propertysheet? Do I understand this right? (I remember having problems when using properties not defined in a sheet somewhere.. or am I mistaken completely somehow? ;-) > >When changing the loadAttrib to something else (non existing), the newItem > is working > >but instead getItem is not working anymore as it returns None only.. > (somehow the zsql > >method is not even called thus the skinscript seems not to work in that > case (I guess > >because the loadAttrib is not defined in it somewhere)). > > Right. The load attribute has to be one defined in a provider, and which > will end up being "NOT_FOUND" if the object doesn't exist in the table > you're querying. I will experiment a little with this information. Hope it helps :) Thanks! -- christian -- COM.lounge http://comlounge.net/ communication & design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and SQL
At 05:29 PM 2/19/01 +0100, Christian Scholz wrote: >> >> You need to use an attribute which the object has *if and only if* it >> exists in the database. If the class has the attribute defined, all >> instances exist, and you can't even load it with SkinScript because >> ZPatterns uses __getattr__ to redefine attributes, and that doesn't work if >> the attribute already exists in the class. > >So I shouldn't define it inside the ZClass propertysheet? >Do I understand this right? >(I remember having problems when using properties not defined in a >sheet somewhere.. or am I mistaken completely somehow? ;-) You can't do this with a load attribute, because a default value will exist. The easiest way to deal with this is simply to have a seperate attribute name just for loading, or use an attribute that isn't on a property sheet. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Design explanation (Was: SkinScripts instantiating new objects)
At 16:21 2001-02-16, Steve Alexander wrote: >Stefan Karlsson wrote: > >> >> BTW is it possible to save the ProjektHandler instance persistently >> in the attribute? Is there an easier way than creating a separate >> specialist for the ProjektHandler class and storing the instances there? > >I think you're getting design and implementation confused here. > >Should ProjektHandlers be a Dataskins? If so, they should live in their own Rack. >Or, does a ProjectHandler really belong as a part of the instance of something else? >In this latter case, you could add a ProjectHandler as an attribute. >As to whether this is a wise thing to do; well, I can't say, as I don't know what >problem you're trying to solve. I have found a workaround for the 'Error computing attribute' problem by instantiating the ProjektHandler object directly in __bobo_traverse__: def __bobo_traverse__(self, REQUEST, name): if name=='projekt': return self.getNewProjektHandler(self,id, 'Projektagare').__of__(self) else: return getattr(self, name) For those of you that are interested in a long explanation of how I designed the system, read on... A ProjektHandler is a ZPHandler that is a "virtual folder" that looks like a normal Zope folder but doesn't store any objects in itself. Instead the storage is delegated to ZPatterns. There is also an OMHandler class that implements the same interface as ZPHandler but stores the objects in itself like ObjectManager, but that's another story. In each class that has an aggregate to another class I instantiate a handler for that other class. As an example, look at the UML class diagram below. We can see that both A and C has an aggregate to class B, that is, a one-to-many relationship. A also has an aggregate to D. X=diamond=aggregate +-+ * +-+ ! A !X! D ! +-+ +-+ X ! ! * +-+ ! B ! +-+ ! * ! X +-+ ! C ! +-+ So what we need is a handler class that manages objects of class B, so we create a BHandler by simply subclassing ZPHandler and telling it what objects to handle. One BHandler instance is put into A and another is put into C. Both instances are called 'bs'. We also need a DHandler that is put into A. The nice thing is that it is very easy to get management tabs for B:s and D:s in A and B:s in C in the management interface. Another nice thing is that B instances actually seems to exist in multiple parents! And all objects seems to exist as normal Zope objects even if the are stored in SQL database. Now instantiate objects of type A, B and C and call them a1, b1, c1. From python we can write a1.bs.getItem('b1) to get the b1 object. We can of course also write c1.bs.getItem('b1') and get the same object. The handler attribute bs is instantiated by a ZPatterns skinscript as a new object when they are first accessed in every transaction Now wouldn't it be nice to access this URL: http:/server/path/to/a1/bs/manage_workspace to get the management interface for the B objects belonging to A? But here comes the problem! This doesn't work for me. I get the 'Error computing attribute' in ZPatterns. I have also tried calling self.a.bs.getItem('b1') in __bobo_traverse__ but get the same error. As I said I have found a workaround but I suspect it's a bug in ZPatterns... Anyway, this was the way I designed this system and it would be nice to have some comments. Thanks Steve for your help! /Stefan Karlsson Everynet Consulting ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and SQL
Hi! > >So I shouldn't define it inside the ZClass propertysheet? > >Do I understand this right? > >(I remember having problems when using properties not defined in a > >sheet somewhere.. or am I mistaken completely somehow? ;-) > > You can't do this with a load attribute, because a default value will > exist. The easiest way to deal with this is simply to have a seperate > attribute name just for loading, or use an attribute that isn't on a > property sheet. Ok, I now removed customer_id (which won't be set anyway as this is the id set by the database automatically) from the propertysheet and used this as loading attribute. Seems to work now :) (though I am still confused a little, as I tried one non-existing attribute and it didn't work. But this one also was not defined inside the SkinScript and the database). But it's working now, so it's ok :) Thanks again! Christian -- COM.lounge http://comlounge.net/ communication & design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Waaagh! Python Script won't allow __setitem__
From: Chris Withers <[EMAIL PROTECTED]> > I've got an object which implements __setitem__ in such a way that it's > perfectly safe for use in Python Scripts. Sadly, it seems that Evan's Byte Code > hacks won't let me do this :-( The only way that the security code can know that your __setitem__ is safe is to rename (or alias) it to __guarded_setitem__. Ditto for other such methods. > If I try and do: > > if type(x) == type(0): Use the Script builtin "same_type" instead: if same_type(x, 0): # Whatever Cheers, Evan @ digicool & 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Waaagh! Python Script won't allow __setitem__
Evan Simpson wrote: > > The only way that the security code can know that your __setitem__ is safe > is to rename (or alias) it to __guarded_setitem__. Ditto for other such > methods. Cool :-) Hmmm... I'm sure __getitem__ works okay though ;-) > > if type(x) == type(0): > > Use the Script builtin "same_type" instead: > > if same_type(x, 0): > # Whatever But what's so bad about type()?! cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Waaagh! Python Script won't allow __setitem__
From: Chris Withers <[EMAIL PROTECTED]> > But what's so bad about type()?! When applied to an Extension Class, it gives you access to the actual class, rather than a nice inert type. Cheers, Evan @ digicool & 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Waaagh! Python Script won't allow __setitem__
Evan Simpson wrote: > > From: Chris Withers <[EMAIL PROTECTED]> > > But what's so bad about type()?! > > When applied to an Extension Class, it gives you access to the actual class, > rather than a nice inert type. Hmmm arguably a bug in ExtensionClass, but not one I'm gonna try and fix ;-) Oh well, s'pose it's a good enough reason :-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Newbie
Hi all, I hope I am not posting this to the wrong newsletter, I am seeking some advice regarding using zope on my organizations site.. I am creating a Developers Recouse Community site, which will have a lot of features, I was hoping someone may be able to point me in the direction to accomplishing these.. These are the sections that I am currently planning :- a) A structural database of articles/tutorials on different subjects. b) Forums, Members Area (high emphasis on the members area, I really need to add features and customize this area) Possible File directory, i.e Freshmeat type thing c) Job Board, A complex job resume posting and employer front end job board. possibly with an emplyer login area, not sure whther to give same access to standard members. As a nebie to Zope/DTML/Python these tasks seem a little daunting to me - I am aware of existing products like ZopePTK and was wondering whether this would provide good ground for such a site as above. Please let me know your comments/suggestion - they will be greatly appreciated. Thank You. John ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Python Product as DataSkin
Michael R. Bernstein wrote: > Steve Alexander wrote: > >> Is the __init__ method of DataSkin getting called? >> >> This would happen if, for example, you define an __init__ method in your >> class, but you don't use something like: >> >> from Globals import default__class_init__ >> >> default__class_init__(yourClass) >> >> At least, I *think* that's one of the things that default__class_init__ >> does. Nope... I got confused. Globals.default__class_init__ sets up the security attributes for you class, from whatever combination of security declarations you've used. In Zope 2.3) it is aliased to Globals.InitializeClass. Use it by having import Globals somewhere in your class definition, and Globals.InitializeClass(YourClassName) at the end. See the following URL for more information: http://www.zope.org//Wikis/DevSite/Projects/DeclarativeSecurity/ZopeSecurityForDevelopers >> Otherwise, you'll need to make sure you call DataSkin.__init__ >> from your __init__ method, probably using Acquisition.inheritedAttribute.) So, at the start of your __init__ method, call: NameOfYourClass.inheritedAttribute('__init__')(self, id) Your __init__ method might look like this: def __init__(self, id, title): FooClass.inheritedAttribute('__init__')(self, id) # rest of your __init__ method -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and SQL
At 05:50 PM 2/19/01 +0100, Christian Scholz wrote: > >(though I am still confused a little, as I tried one non-existing >attribute and it didn't work. But this one also was not defined inside >the SkinScript and the database). As I said, the attribute must exist if and only if the row is in the database. Thus, it must *not* exist on the propertysheet, and it *must* exist in your SkinScript. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Waaagh! Python Script won't allow __setitem__
At 05:25 PM 2/19/01 +, Chris Withers wrote: > >Hmmm arguably a bug in ExtensionClass, but not one I'm gonna try and fix ;-) > It's not a bug, it's a feature -- the feature that is the reason for the very existence of ExtensionClasses in the first place: merging of the notion of type and class. Of course, type() could always be replaced with a safe_type function that checked whether the type() was an ExtensionClass and returned something inert. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] RE: [Zope] Newcomer
Andy: Thank you for replying to my questions. I'd like to clarify some of them, and see where I should be asking them. I do realize they are not Zope-specific issues. My assumption is that other Zope developers have encountered similar needs and have solved them. Re client stuff: Part of the problem for me is that I an not sufficiently familiar with the technology; I have heard terms like "Java Swing" and "Applets" that (I think) address what I want; form components that send data to and receive updates from a server process without retransmit ting the entire page. So this question is: How do I use (Zope and) Python to receive data from such components and send updated data to one or more of these components? The person who introduced me to Zope said that there was a Python runtime version that could run bytecode in a page using the JVM in a browser. So I need to know if this is true, and how to set it up. > Uggh Visual FoxPro? Don't use foxpro Well I wish I had have known that 4.5 years ago. Microsoft sold me a piece of junk with really slick advertising. At that time it was the only tool I knew of that was capable of cross-platform (PC-MAC) application development. I did not know that the RAD they promised was almost completely negated by the abysmal documentation, bugs, errors; I also did not know that they were dropping Mac support. Sigh. Those issues aside, I have enjoyed VFP; it has been my introduction to OOP and we do have a marketable product. The goal now is to re-engineer the application for the Web using (I presume) Zope, Python, and mySQL. > what ODBC product are you using. "Zope ODBC Database Adapter 3.1.0b2 (Development) 1999/09/03" Bob Gailer mailto:[EMAIL PROTECTED] 303-442-2625 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] RE: [Zope] Newcomer
> The person who introduced me to Zope said that there was a Python runtime > version that could run bytecode in a page using the JVM in a browser. So I > need to know if this is true, and how to set it up. Sorry I couldn't really tell you. I've never used it myself. > > Uggh Visual FoxPro? Don't use foxpro > > Well I wish I had have known that 4.5 years ago. Microsoft sold me a piece > of junk with really slick advertising. At that time it was the only tool I > knew of that was capable of cross-platform (PC-MAC) application development. > I did not know that the RAD they promised was almost completely negated by > the abysmal documentation, bugs, errors; I also did not know that they were > dropping Mac support. Sigh. Those issues aside, I have enjoyed VFP; it has > been my introduction to OOP and we do have a marketable product. The goal > now is to re-engineer the application for the Web using (I presume) Zope, > Python, and mySQL. Well if that's the case so be it. I've never used it so again if its got ODBC problems I could really tell you where to look. > > what ODBC product are you using. > > "Zope ODBC Database Adapter 3.1.0b2 (Development) 1999/09/03" Hmm thats the same one Im using. Well Im stumped. Sorry it was a while ago and I cant seem to remember what your actual problem was... -- Andy McKay. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Directions Roadmap Posted
Hello Zopistas, I am excited to announce a Zope Directions Roadmap. http://dev.zope.org/Resources/ZopeDirections.html This document summarizes current thinking at DC about where the Zope platform is going from an architectural point of view. It summarizes informal conversations that we've been having internally for the past couple months. This paper talks about how we'd like to improve Zope to make it easier for developers. It puts some existing initiatives (e.g. Presentation Templates, and CMF) in context, and discusses potential future projects like moving to a component architecture. I should point out that this document is not a concrete plan so much as a statement of what's on our minds. Zope development will continue to operate openly in the fishbowl. We'd love to hear what you have to say. Are we heading in the right direction? Is there something else that we should be doing instead to help developers? Let us know. And when we begin new fishbowl projects (look for a component architecture project soon) jump in and help define Zope's future! -Amos -- Amos Latteier mailto:[EMAIL PROTECTED] Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Python Product as DataSkin
Steve Alexander wrote: > > Michael R. Bernstein wrote: > > > Steve Alexander wrote: > > > >> Is the __init__ method of DataSkin getting called? > >> > >> This would happen if, for example, you define an __init__ method in your > >> class, but you don't use something like: > >> > >> from Globals import default__class_init__ > >> > >> default__class_init__(yourClass) > >> > >> At least, I *think* that's one of the things that default__class_init__ > >> does. > > Nope... I got confused. Globals.default__class_init__ sets up the security > attributes for you class, from whatever combination of security > declarations you've used. > > In Zope 2.3) it is aliased to Globals.InitializeClass. So, if I'm developing this on 2.2, I need to use Globals.default__class_init__(FooClass) instead of Globals.InitializeClass(FooClass)? > Use it by having > > import Globals > > somewhere in your class definition, If 'import Globals' appears at the start of the FooClass.py file, does it still need to appear in the class definition itself? > and > > Globals.InitializeClass(YourClassName) > > at the end. At the end on the file, or the end of the class definition? Thanks for the help, Michael Bernstein. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns goes crazy after ZClass change
Hi, I have a Rack which uses ZClass Company for storage. I renamed Company to CompanyX and created a new Company ZClass, giving it the same methods, propertysheets and properties as CompanyX. When I tried to view editInstanceForm_html of an instance of this class, I got the method stored in CompanyX. So I deleted CompanyX from the control panel. I still got the CompanyX method. I used the Rack's Storage tab to select another ZClass. Still got the method from CompanyX. when I click Remove Orphaned Slots on this Rack, I get: AttributeError _setRack Traceback (innermost last): File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 187, in publish File /opt/Zope-2.3.0-linux2-x86/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: ProviderContainer) File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 171, in publish File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_pack) File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_pack) File /opt/Zope/lib/python/Products/ZPatterns/Rack.py, line 418, in manage_pack (Object: ProviderContainer) File /opt/Zope/lib/python/Products/ZPatterns/Rack.py, line 59, in getItem (Object: ProviderContainer) File /opt/Zope/lib/python/Products/ZPatterns/Rack.py, line 114, in retrieveItem (Object: ProviderContainer) File /opt/Zope-2.3.0-linux2-x86/lib/python/OFS/Uninstalled.py, line 110, in __getattr__ (Object: broken) AttributeError: (see above) Any ideas how I can fix this without recreating the Rack and all my persistent data? -- -- Itai Tavor -- "Je sautille, donc je suis."-- [EMAIL PROTECTED]-- - Kermit the Frog -- -- -- -- "If you haven't got your health, you haven't got anything" -- ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Zope 2.2.4 Dying
Hi all, my problems are going on :( and i need help. 2001-02-19T20:21:07 ERROR(200) zdaemon zdaemon: Mon Feb 19 21:21:07 2001: Aiieee! 20154 exited with error code: 13 2001-02-19T20:21:07 INFO(0) zdaemon zdaemon: Mon Feb 19 21:21:07 2001: Houston, we have forked 2001-02-19T20:21:07 INFO(0) zdaemon zdaemon: Mon Feb 19 21:21:07 2001: Hi, I just forked off a kid: 938 2001-02-19T20:21:07 INFO(0) zdaemon zdaemon: Mon Feb 19 21:21:07 2001: Houston, we have forked 2001-02-19T20:21:08 ERROR(200) zdaemon zdaemon: Mon Feb 19 21:21:08 2001: Aiieee! 938 exited with error code: 256 2001-02-20T07:23:48 INFO(0) zdaemon zdaemon: Tue Feb 20 08:23:48 2001: Houston, we have forked 2001-02-20T07:23:48 INFO(0) zdaemon zdaemon: Tue Feb 20 08:23:48 2001: Hi, I just forked off a kid: 2100 2001-02-20T07:23:48 INFO(0) zdaemon zdaemon: Tue Feb 20 08:23:48 2001: Houston, we have forked as Shane Hathaway schrieb: > Andre Schubert wrote: > > > > Hi, > > > > I'am using Zope 2.2.4 with the required patches. > > Python 1.5.2 > > Immunix 6.2 (redhat) - Production System - with apache-1.3.14-2.6.2 under a > > Named Virtual Host > > Zope is running with Zope.cgi > > I would guess that Apache is disconnecting its pipe to Zope.cgi somehow, > which results in a SIGPIPE (or broken pipe). Unfortunately, I don't > have much experience with this kind of setup; maybe someone else can > chime in? > > Shane > > > Shane Hathaway schrieb: > > > > > Andre Schubert wrote: > > > > > > > > Hi, > > > > > > > > since the last time i had some problems with my zope server. > > > > The zope 2.2.4 running under linux dies unexpectly with the following > > > > messages. > > > > > > > > 2001-02-16T01:50:08 ERROR(200) zdaemon zdaemon: Fri Feb 16 02:50:08 > > > > 2001: Aiieee! 5451 exited with error code: 13 > > > > -- > > > > 2001-02-16T02:29:38 ERROR(200) zdaemon zdaemon: Fri Feb 16 03:29:38 > > > > 2001: Aiieee! 10313 exited with error code: 13 > > > > > > > > What does the error code 13 say and could anyone help me to solve the > > > > problem > > > > > > Hmm, according to "kill -l", code 13 is "SIGPIPE". What's your setup? > > > > > > Shane > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )