SV: Subject: [Zope-dev] change ownership
I can get it to work :-/ I get an attributeerror on aq_inner in lib/python/AccessControl/Owned.py, line 302, in ownerInfo Seems as if the user i provide isn't of the right type? How do you use your method? How is it being called? /Magnus Magnus, No, changeOwnership is not exposed for TTW calling. But you can expose it through an external method... I used this one on a ZClass. def set_owner(self, user): self.changeOwnership(user) return ___ 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: Subject: [Zope-dev] change ownership
I call the external method like this from DTML... set_owner(restrictedTraverse(path_to_user)), where path to user is a physical path, but I'm using the ZUserFolder, so I can use the restrictedTraverse to get to users. UserFolder has a different API. You could do this if your acl_users is a standard UserFolder... set_owner(acl_users.getUser(user_name)) in DTML or make your external method this... def set_owner(self, user_name): self.changeOwnership(self.acl_users.getUser(user_name)) OK, so that should keep you busy for a while. Anyway, the point is that the parameter to changeOwnership is a User _object_. Good luck. --Tim -Original Message- From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 7:25 AM To: 'Tim McLaughlin'; '[EMAIL PROTECTED]'; Magnus Heino (Rivermen) Subject: SV: Subject: [Zope-dev] change ownership I can get it to work :-/ I get an attributeerror on aq_inner in lib/python/AccessControl/Owned.py, line 302, in ownerInfo Seems as if the user i provide isn't of the right type? How do you use your method? How is it being called? /Magnus Magnus, No, changeOwnership is not exposed for TTW calling. But you can expose it through an external method... I used this one on a ZClass. def set_owner(self, user): self.changeOwnership(user) return ___ 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 )
SV: Subject: [Zope-dev] change ownership
def set_owner(self, user_name): self.changeOwnership(self.acl_users.getUser(user_name)) OK, so that should keep you busy for a while. Anyway, the Not long enough :-P point is that the parameter to changeOwnership is a User _object_. Good luck. Ive got this external method in a zclass: def setObjectOwner(self, username): self.changeOwnership(self.acl_users.getUser(username)) I call it like http://localhost:8080/myobject/setObjectOwner?username=foo and get this error: Zope Error Zope has encountered an error while publishing this resource. Error Type: AttributeError Error Value: aq_inner Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Products/ExternalMethod/Exter nalMethod.py, line 262, in __call__ (Object: setObjectOwner) (Info: ((FooObject instance at 873bd78, 'david'), {}, None)) File /usr/home/magnus/www/Zope-2.3.2-src/Extensions/Owner.py, line 2, in setObjectOwner (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/Owned.py, line 168, in changeOwnership (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/Owned.py, line 302, in ownerInfo AttributeError: (see above) ___ 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 )
SV: Subject: [Zope-dev] change ownership
The one that comes with Zope. /Magnus -Ursprungligt meddelande- Från: Tim McLaughlin [mailto:[EMAIL PROTECTED]] Skickat: den 10 maj 2001 15:26 Till: 'Magnus Heino (Rivermen)'; Tim McLaughlin Kopia: '[EMAIL PROTECTED]' Ämne: RE: Subject: [Zope-dev] change ownership What kind of UserFolder are you using... LoginManager or something? -Original Message- From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 9:13 AM To: 'Tim McLaughlin'; Magnus Heino (Rivermen) Cc: '[EMAIL PROTECTED]' Subject: SV: Subject: [Zope-dev] change ownership def set_owner(self, user_name): self.changeOwnership(self.acl_users.getUser(user_name)) OK, so that should keep you busy for a while. Anyway, the Not long enough :-P point is that the parameter to changeOwnership is a User _object_. Good luck. Ive got this external method in a zclass: def setObjectOwner(self, username): self.changeOwnership(self.acl_users.getUser(username)) I call it like http://localhost:8080/myobject/setObjectOwner?username=foo and get this error: Zope Error Zope has encountered an error while publishing this resource. Error Type: AttributeError Error Value: aq_inner -- -- Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Products/Extern alMethod/Exter nalMethod.py, line 262, in __call__ (Object: setObjectOwner) (Info: ((FooObject instance at 873bd78, 'david'), {}, None)) File /usr/home/magnus/www/Zope-2.3.2-src/Extensions/Owner.py, line 2, in setObjectOwner (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O wned.py, line 168, in changeOwnership (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O wned.py, line 302, in ownerInfo AttributeError: (see above) ___ 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: Subject: [Zope-dev] change ownership
What kind of UserFolder are you using... LoginManager or something? -Original Message- From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 9:13 AM To: 'Tim McLaughlin'; Magnus Heino (Rivermen) Cc: '[EMAIL PROTECTED]' Subject: SV: Subject: [Zope-dev] change ownership def set_owner(self, user_name): self.changeOwnership(self.acl_users.getUser(user_name)) OK, so that should keep you busy for a while. Anyway, the Not long enough :-P point is that the parameter to changeOwnership is a User _object_. Good luck. Ive got this external method in a zclass: def setObjectOwner(self, username): self.changeOwnership(self.acl_users.getUser(username)) I call it like http://localhost:8080/myobject/setObjectOwner?username=foo and get this error: Zope Error Zope has encountered an error while publishing this resource. Error Type: AttributeError Error Value: aq_inner Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Products/ExternalMethod/Exter nalMethod.py, line 262, in __call__ (Object: setObjectOwner) (Info: ((FooObject instance at 873bd78, 'david'), {}, None)) File /usr/home/magnus/www/Zope-2.3.2-src/Extensions/Owner.py, line 2, in setObjectOwner (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/Owned.py, line 168, in changeOwnership (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/Owned.py, line 302, in ownerInfo AttributeError: (see above) ___ 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: Subject: [Zope-dev] change ownership
Do you have multiple acl_users objects in the acquisition context of the object? Because if you do and the self.acl_users will acquire (possibly) the wrong user database. If that's not the problem, I'm gonna have to let it cook, and I'll probably come up w/ somethin' later. --Tim plug You could also try a ZUserFolder and use restrictedTraverse if you want. :-) /plug -Original Message- From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 9:23 AM To: 'Tim McLaughlin'; Magnus Heino (Rivermen) Cc: '[EMAIL PROTECTED]' Subject: SV: Subject: [Zope-dev] change ownership The one that comes with Zope. /Magnus -Ursprungligt meddelande- Från: Tim McLaughlin [mailto:[EMAIL PROTECTED]] Skickat: den 10 maj 2001 15:26 Till: 'Magnus Heino (Rivermen)'; Tim McLaughlin Kopia: '[EMAIL PROTECTED]' Ämne: RE: Subject: [Zope-dev] change ownership What kind of UserFolder are you using... LoginManager or something? -Original Message- From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 10, 2001 9:13 AM To: 'Tim McLaughlin'; Magnus Heino (Rivermen) Cc: '[EMAIL PROTECTED]' Subject: SV: Subject: [Zope-dev] change ownership def set_owner(self, user_name): self.changeOwnership(self.acl_users.getUser(user_name)) OK, so that should keep you busy for a while. Anyway, the Not long enough :-P point is that the parameter to changeOwnership is a User _object_. Good luck. Ive got this external method in a zclass: def setObjectOwner(self, username): self.changeOwnership(self.acl_users.getUser(username)) I call it like http://localhost:8080/myobject/setObjectOwner?username=foo and get this error: Zope Error Zope has encountered an error while publishing this resource. Error Type: AttributeError Error Value: aq_inner -- -- Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Products/Extern alMethod/Exter nalMethod.py, line 262, in __call__ (Object: setObjectOwner) (Info: ((FooObject instance at 873bd78, 'david'), {}, None)) File /usr/home/magnus/www/Zope-2.3.2-src/Extensions/Owner.py, line 2, in setObjectOwner (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O wned.py, line 168, in changeOwnership (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O wned.py, line 302, in ownerInfo AttributeError: (see above) ___ 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] Object dereferancing Question
R. David Murray wrote: On Tue, 8 May 2001, Jeff wrote: I have created a product with a zclass that contains a zclass; classA contains classB. [...] Now for the part I don't understand. I have a page where I would like dynamically display a classB object. I used the following: dtml-var expr=_.getitem(index_object, 1) Where 'index_object' is the id of a classB object within the name space (same folder). I thought that this would call the 'default rendering' for the named object, but instead returns the object. '1' means call the object if it is callable. ZClasses are not callable. Therefore you get the object back. See the Renderable Product if you want to fix this grin. --RDM This strikes me as a bug. How would you all react to making ZClass instances callable and have their behavior be: look for an instance method index_html and call it, and failing that, just return the object. Thoughts? -- | 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 )
Re: [Zope-dev] Question about import code
Fred Wilson Horch wrote: The problem that happens on import is a KeyError on line 194 of this bit of code: lines 192-197 of lib/python/ZODB/ExportImport.py ooid=h[:8] if oids: oid=oids[ooid] if type(oid) is TupleType: oid=oid[0] else: oids[ooid]=return_oid=oid=new_oid() If I change this code to ooid=h[:8] if oids and oids.has_key(ooid): oid=oids[ooid] if type(oid) is TupleType: oid=oid[0] else: oids[ooid]=return_oid=oid=new_oid() then the import appears to succeed, but only the final object in the file is actually imported. Importing multiple objects simultaneously could result in a fair amount of confusion... But if you really think it's a good idea, if you used a list called return_oids instead, and appended to this list in the code above, you'd probably get what you're looking for. ooid=h[:8] if oids and oids.has_key(ooid): oid=oids[ooid] if type(oid) is TupleType: oid=oid[0] else: oids[ooid] = oid = new_oid() return_oids.append(oid) Then at the end of the function you'll want to dereference each of the OIDs and return a list of objects. Everything that uses import will have to be modified, unless you change the name of the method and provide a wrapper method with the existing signature. Note that for Zope 2.4 this code has changed a bit. Import is now done as a subtransaction rather than a transaction on the side. 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] Experiments with ORMapping
Kapil (and others), Although very sketchy and I can't guarantee anything works, my experiments with object-relational mapping in Zope are found at http://www.zope.org/Members/hathawsh/ormapping.tar.gz . If ORMapping.py is in the ZODB directory, you can use the following custom_zodb.py to run Zope on top of Postgres using PoPy: import ZODB from ZODB.ORStorage import ORStorage import PoPy connection = PoPy.connect('user=zodb dbname=zodb') storage = ORStorage('pgsql!', connection, PoPy, create=1) DB = ZODB.DB(storage) The initial approach turned out to be rather problematic, since by default everything is stored in Postgres as a large binary object. Zope creates literally thousands of objects when starting for the first time and a few hundred each time thereafter. Postgres does not deal well with large binary objects so start time is something on the order of 10 minutes this way and hard drive space gets eaten up faster than Jim can code. :-) But storage of binary pickles was never the intention anyway. I created a little interface that would allow you to store different classes in different PostgreSQL tables. Before I got to implementing anything, though, I had to move to another project. But the file sketch shows (I hope) what I had in mind for making this work: programmers would call a bunch of functions that would put together a relational mapping tree. Now, in our discussion yesterday we decided ORStorage wasn't the right way to achieve relational mapping because there is no way for the database storage layer to have any context just given an OID. If we instead consider writing a replacement for the stuff that's mainly in Connection.py, life gets a lot simpler. At this level it *is* possible to know the parent OID of an object, though the current codebase does not use this opportunity. Also, we wouldn't have to pickle and unpickle unnecessarily. So, if we have context, the relational mapping tree can work. It would turn Zope into a purely relational application server, which a lot of folks apparently want. ;-) 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] Experiments with ORMapping
Hi Shane, --On Donnerstag, 10. Mai 2001 11:32 -0400 Shane Hathaway [EMAIL PROTECTED] wrote: ... But storage of binary pickles was never the intention anyway. I created a little interface that would allow you to store different classes in different PostgreSQL tables. Before I got to implementing anything, Is this much like the ZPatterns approach? Or do we want to make some automatism to get tables created and destroyed according to ZClasses needs? though, I had to move to another project. But the file sketch shows (I hope) what I had in mind for making this work: programmers would call a bunch of functions that would put together a relational mapping tree. Now, in our discussion yesterday we decided ORStorage wasn't the right way to achieve relational mapping because there is no way for the database storage layer to have any context just given an OID. If we instead consider writing a replacement for the stuff that's mainly in Connection.py, life gets a lot simpler. At this level it *is* possible to know the parent OID of an object, though the current codebase does not use this opportunity. Also, we wouldn't have to pickle and unpickle unnecessarily. So, if we have context, the relational mapping tree can work. It would turn Zope into a purely relational application server, which a lot of folks apparently want. ;-) Oh, do they? ;) Me dont :-) Regards Tino ___ 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] Experiments with ORMapping
Tino Wildenhain wrote: But storage of binary pickles was never the intention anyway. I created a little interface that would allow you to store different classes in different PostgreSQL tables. Before I got to implementing anything, Is this much like the ZPatterns approach? Which part of ZPatterns are you referring to? The idea is to (generally) put all instances of a class in a certain table. But the implementation details having nothing in common with ZPatterns. Or do we want to make some automatism to get tables created and destroyed according to ZClasses needs? I was thinking there would be a default table where everything gets stored by default. A programmer then tells the ORMapping about specific classes and how to store them. So, if we have context, the relational mapping tree can work. It would turn Zope into a purely relational application server, which a lot of folks apparently want. ;-) Oh, do they? ;) Me dont :-) You know, it might be possible to get a team together to implement this. How many out there would be interested in pursuing it further? IMHO it's not as much work as it sounds at first. Zope being so object-oriented, you really can replace one of its most fundamental assumptions (an OODBMS) with something else (an RDBMS) without a huge effort. 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] Question about import code
Hi Shane, You wrote: Importing multiple objects simultaneously could result in a fair amount of confusion... Can you elaborate? When you import a folder, for example, it imports the folder and all objects in it. Why is it any different to import two unrelated objects? Would it be better to do this in two separate transactions? Or two subtransactions? But if you really think it's a good idea, if you used a list called return_oids instead, and appended to this list in the code above, you'd probably get what you're looking for. I tried this approach, too, and I get a ConflictError. (I can send the code and traceback if you're interested.) Note that for Zope 2.4 this code has changed a bit. Import is now done as a subtransaction rather than a transaction on the side. Thanks for the heads up. When you say subtransaction, a subtransaction of what? I'm familiar with subtransactions being atomic parts of a larger transaction. I'm not sure what this larger transaction would be in this case. If I start an import, does that start a transaction with each object's import being a subtransaction of the whole thing? (If that's the case, then I don't understand why importing several objects at once would be confusing.) Is there any documentation on how to export from and import to the ZODB? The code I'm wading through has a lot of extraneous stuff thrown in. I'd like to be able to just try exporting and importing objects from a simple Python script so I understand what's going on. Thanks, Fred -- Fred Wilson Horch mailto:[EMAIL PROTECTED] Executive Director, EcoAccess http://ecoaccess.org/ P.O. Box 2823, Durham, NC 27715-2823phone: 919.419-8567 ___ 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] PropertyManagerEvents proposal: Last call for review
I have a proposal up for discussion on adding hookable callbacks to property events. If you are interested in such topics as property validation, CatalogAware syncing on property changes, etc, please take a look within the next few days. I think this is something that many people could use, so your comments are valued. http://dev.zope.org/Wikis/DevSite/Proposals/PropertyManagerEvents Next week I would like to deliver the patch to implement this, so if you have something to say on this topic speak now! -- | 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 )
oodb philosophics ;) was: Re: [Zope-dev] Experiments with ORMapping
Hi shane, I think the motivation people want an RDBMS storage beneth zodb is because they understand RDBMSes these days are performant, relieable and can quiete easy maintained. I've seen Java implementations using this approach to achive persistens using as example Powertier[tm] to explicit map oop data to an RDBMS. I didnt like it because you have to map your objects each time you create a class, keep in mind not to infere with others etc... Would it not be better to improve the abilities of the Filestorage to handle updates better? May be most of the storage system in C? With logfiles like modern RDBMSes use to incorporate fast changes? However, to avoid pickling/unpickling and may be to update on attribute-change, we need the approach you mentioned. What about using a real oodb for zope? Dont remember any particular product name, but I heard something. Regards Tino Wildenhain --On Donnerstag, 10. Mai 2001 12:39 -0400 Shane Hathaway [EMAIL PROTECTED] wrote: Tino Wildenhain wrote: But storage of binary pickles was never the intention anyway. I created a little interface that would allow you to store different classes in different PostgreSQL tables. Before I got to implementing anything, Is this much like the ZPatterns approach? Which part of ZPatterns are you referring to? The idea is to (generally) put all instances of a class in a certain table. But the implementation details having nothing in common with ZPatterns. Or do we want to make some automatism to get tables created and destroyed according to ZClasses needs? I was thinking there would be a default table where everything gets stored by default. A programmer then tells the ORMapping about specific classes and how to store them. So, if we have context, the relational mapping tree can work. It would turn Zope into a purely relational application server, which a lot of folks apparently want. ;-) Oh, do they? ;) Me dont :-) You know, it might be possible to get a team together to implement this. How many out there would be interested in pursuing it further? IMHO it's not as much work as it sounds at first. Zope being so object-oriented, you really can replace one of its most fundamental assumptions (an OODBMS) with something else (an RDBMS) without a huge effort. 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] Question about import code
Fred Wilson Horch wrote: You wrote: Importing multiple objects simultaneously could result in a fair amount of confusion... Can you elaborate? When you import a folder, for example, it imports the folder and all objects in it. If there are some objects in the folder that have conflicting names and others that don't, what do you do? Also, if you're thinking about providing this functionality, what about spanning multiple folders? What if some folders already exist? The capability could change user expectations, you see, and you may need to deal with them. But that's just advice and you can freely ignore it. :-) Thanks for the heads up. When you say subtransaction, a subtransaction of what? I'm familiar with subtransactions being atomic parts of a larger transaction. I'm not sure what this larger transaction would be in this case. If I start an import, does that start a transaction with each object's import being a subtransaction of the whole thing? That's right. Is there any documentation on how to export from and import to the ZODB? Perhaps. Look at the interfaces Wiki. The code I'm wading through has a lot of extraneous stuff thrown in. I'd like to be able to just try exporting and importing objects from a simple Python script so I understand what's going on. An external method could do it. Look at what _getCopy() does in OFS/CopySupport.py. 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: oodb philosophics ;) was: Re: [Zope-dev] Experiments with ORMapping
Tino Wildenhain wrote: I think the motivation people want an RDBMS storage beneth zodb is because they understand RDBMSes these days are performant, relieable and can quiete easy maintained. The other motivations for an RDBMS are (1) people have existing schemas and want Zope to access the same data as their existing apps, and they want it to be transparent, and (2) tables with millions of entries are easily stored in Zope but the perception is that the catalog isn't as fast as a database index. No one has done any tests AFAIK. I've seen Java implementations using this approach to achive persistens using as example Powertier[tm] to explicit map oop data to an RDBMS. I didnt like it because you have to map your objects each time you create a class, keep in mind not to infere with others etc... That's one reason ZODB is so nice. You can write an application without writing a formal schema. Would it not be better to improve the abilities of the Filestorage to handle updates better? May be most of the storage system in C? With logfiles like modern RDBMSes use to incorporate fast changes? However, to avoid pickling/unpickling and may be to update on attribute-change, we need the approach you mentioned. What about using a real oodb for zope? Dont remember any particular product name, but I heard something. Actually OracleStorage and bsddbstorage, recently released, are designed to address concerns about performance and reliability, and they do an excellent job at it. And I consider ZODB as real an OODB as anything else. (In some ways it's the best out there IMHO.) 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: oodb philosophics ;) was: Re: [Zope-dev] Experiments with ORMapping
Tino Wildenhain wrote: Hi shane, I think the motivation people want an RDBMS storage beneth zodb is because they understand RDBMSes these days are performant, relieable and can quiete easy maintained. I've seen Java implementations using this approach to achive persistens using as example Powertier[tm] to explicit map oop data to an RDBMS. I didnt like it because you have to map your objects each time you create a class, keep in mind not to infere with others etc... Would it not be better to improve the abilities of the Filestorage to handle updates better? May be most of the storage system in C? With logfiles like modern RDBMSes use to incorporate fast changes? However, to avoid pickling/unpickling and may be to update on attribute-change, we need the approach you mentioned. What about using a real oodb for zope? Dont remember any particular product name, but I heard something. Regards Tino Wildenhain It would certainly be an interseting exercise to put Matisse or Objectivity behind Zope as ZODB storage, however I think there will always be kludgeyness because features of Zope wont directly map (like versions). I think the Berkeley storage option will eventually prove to be the ticket. Probably sooner than later. How about XML storage! 8^) You think startup times are slow now... -- | 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 )
Re: [Zope-dev] Experiments with ORMapping
You know, it might be possible to get a team together to implement this. How many out there would be interested in pursuing it further? IMHO it's not as much work as it sounds at first. Zope being so object-oriented, you really can replace one of its most fundamental assumptions (an OODBMS) with something else (an RDBMS) without a huge effort. Hi Shane! Do you know that there already is a project for OR-Mapping in Zope (actually there are two ...)? Ours is SmartObjects (http://demo.iuveno-net.de/iuveno/Products/SmartObjects). Also see the mailing list archive at http://imail.iuveno-net.de/pipermail/smartobjects/. The other is TransWarp, which has a slightly different focus, but Phillip Eby is also on our list, so we won't duplicate efforts. Cheers Joachim ___ 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] Experiments with ORMapping
Joachim Werner wrote: You know, it might be possible to get a team together to implement this. How many out there would be interested in pursuing it further? IMHO it's not as much work as it sounds at first. Zope being so object-oriented, you really can replace one of its most fundamental assumptions (an OODBMS) with something else (an RDBMS) without a huge effort. Do you know that there already is a project for OR-Mapping in Zope (actually there are two ...)? Yes, and I think the projects need to look into replacing parts of ZODB rather than adding complexity. ZODB has pieces that can be split apart and replaced as needed, such as caching, persistence, transactions, the pickle jar, the multi-threaded connection factory, and the storage layer. I'm hoping we can achieve OR mapping by only replacing the pickle jar, i.e. Connection.py. Ours is SmartObjects (http://demo.iuveno-net.de/iuveno/Products/SmartObjects). Also see the mailing list archive at http://imail.iuveno-net.de/pipermail/smartobjects/. Kapil gave Jim and I a good introduction to SmartObjects yesterday. So far, it seems a lot like ZPatterns in that it mandates a new database access API rather than trying to be transparent like ZODB. The other is TransWarp, which has a slightly different focus, but Phillip Eby is also on our list, so we won't duplicate efforts. TransWarp doesn't try to be transparent either AFAICT... 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] ZEO Clients, broken servers, and Z2.pid
On Thu, 10 May 2001, Anthony Baxter wrote: As far as I can see, ZEO clients don't write a pid to Z2.pid until after they've successfully connected to a storage. Is there a reason for this? Probably not. It's nothing to do with ZEO, z2.py does an 'import Zope' before it writes the z2.pid file. -Michel ___ 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] xmlrpc 500 Internal Server Error
[EMAIL PROTECTED] writes: ... File /usr/lib/python1.5/xmllib.py, line 227, in goahead self.syntax_error('illegal character in content') File /usr/lib/python1.5/xmllib.py, line 748, in syntax_error raise RuntimeError, 'Syntax error at line %d: %s' % (self.lineno, message) RuntimeError: Syntax error at line 34: illegal character in content I'm using the latest xmlrpclib.py from www.pythonware.com for the client side - so I'm happy to blame it for generating invalid XML. Maybe a charset mismatch between client and server? Dieter ___ 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] xmlrpc 500 Internal Server Error
Dieter Maurer wrote: [EMAIL PROTECTED] writes: ... File /usr/lib/python1.5/xmllib.py, line 227, in goahead self.syntax_error('illegal character in content') File /usr/lib/python1.5/xmllib.py, line 748, in syntax_error raise RuntimeError, 'Syntax error at line %d: %s' % (self.lineno, message) RuntimeError: Syntax error at line 34: illegal character in content I'm using the latest xmlrpclib.py from www.pythonware.com for the client side - so I'm happy to blame it for generating invalid XML. Maybe a charset mismatch between client and server? Same machine, zope instance talking to itself. Eventually, it won't be, but at the moment it is. Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ 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] xmlrpc: Syntax error at line 34: illegal character in content
Chris Withers wrote: [EMAIL PROTECTED] wrote: RuntimeError: Syntax error at line 34: illegal character in content This was the bane of one of our projects to the point where Andy re-wrote ZMailIn to no-longer use XML-RPC. Yeah, I am currently base64'ing the data, and it works. It's to do with stuff-which-should-probably-be-entities but we never tracked down what wasn't encoding something when it should have done. I'd blame the marshalling code in xmlrpclib.py myself. If you ever fix this, do let us know :-) Unfortunately, I have no time to go chasing around the xmlrpc specs :( Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ 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] xmlrpc: Syntax error at line 34: illegal character in content
Yeah, I am currently base64'ing the data, and it works. Ive seen this in some code but didnt want to say anything for fear of sounding stupid. It doesnt seem right somehow. -- 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 )
Re: [Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content
Andy McKay wrote: Yeah, I am currently base64'ing the data, and it works. Ive seen this in some code but didnt want to say anything for fear of sounding stupid. It doesnt seem right somehow. See, this is the problem. I'm running into crunch-time at the moment, and I really don't have time to check the validity of third-party xmlrpc code. I honestly don't know if it's valid to send arbitrary binary data in an xmlrpc transaction. Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ 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] xmlrpc: Syntax error at line 34: illegal character in content
[EMAIL PROTECTED] wrote: Andy McKay wrote: Yeah, I am currently base64'ing the data, and it works. Ive seen this in some code but didnt want to say anything for fear of sounding stupid. It doesnt seem right somehow. See, this is the problem. I'm running into crunch-time at the moment, and I really don't have time to check the validity of third-party xmlrpc code. I honestly don't know if it's valid to send arbitrary binary data in an xmlrpc transaction. Interestingly, it looks like xmlrpclib.py can *receive* base64-encoded data automagically, but it never *sends* it. ppml.py, found in Zope2/lib/python/Shared/DC/xml, has a convert() method which could serve as a guide for making a patch to xmlrpclib that will enable it to automatically encode in base64 when appropriate. The problem with sending binary data unencoded is line endings: \r\n might be helpfully converted to \n and vice-versa. Other characters can be encoded but apparently parsers treat #10; and #13;#10; as a real line ending. In fact it's time to convert xmlrpclib to use the Expat module (via SAX) in Python 2.1. It should speed it up dramatically. 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] xmlrpc: Syntax error at line 34: illegal character in content
Shane Hathaway wrote: The problem with sending binary data unencoded is line endings: \r\n might be helpfully converted to \n and vice-versa. Other characters can be encoded but apparently parsers treat #10; and #13;#10; as a real line ending. I'm not sure where this leaves me... I think this means that ultimately it's not possible to send binary data which contains 0x10 or 0x1310 in an XML-RPC message. Bummer. Especially with the ~30% bloat incurred by base64 encoding :( In fact it's time to convert xmlrpclib to use the Expat module (via SAX) in Python 2.1. It should speed it up dramatically. I wish we had the luxury of moving to python 2.1 :( Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ 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] OS X support
Hi, Is there any plans for zope to support OS X? terry -- Terry Kerr ([EMAIL PROTECTED]) Adroit Internet Solutions (www.adroit.net) Phone: +61 3 9563 4461 Fax: +61 3 9563 3856 ICQ: 79303381 ___ 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] OS X support
There's a howto on that, I recall seeing. Hi, Is there any plans for zope to support OS X? ___ 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] xmlrpc: Syntax error at line 34: illegal characterin content
Shane Hathaway wrote: I feel like the absence of base-64 encoding is an oversight in the protocol, along with the absence of a null type (which would correspond to None.) That's why I think it's not a kludge to extend XML-RPC. The omission of the explicit null is one of the oldest gripes with XML-RPC (and last time I read up on it, Dave Winer was firmly against its inclusion). It's usually the first thing I add to the spec when I'm working with it. But why is the 30% bloat an issue? The important parts of the base64 module are in C and the encoding and decoding is fast. Encode/decode speed is fine (using binascii, not base64 ;) Mostly it's network bandwidth issue. We're implementing an offline management feature specifically for users who are on the end of a slow link to their server. We're looking at transferring potentially big images. It is therefore a high priority to make the xml-rpc transactions as fast as possible. I'm starting to look around for other mechanisms. I looked into faking file upload form submissions, but Python's support for multipart/form-data is pretty rough - and from my reading, the RFC is rather hazy on the support of unencoded data. Zope to Zope FTP is my next avenue to investigate ;) In fact it's time to convert xmlrpclib to use the Expat module (via SAX) in Python 2.1. It should speed it up dramatically. I wish we had the luxury of moving to python 2.1 :( Actually the sax / expat module is also available for Python 1.5.2, if that helps. Yeah, as long as there's pre-compiled binaries for win32, I'm happy. I'm currently in VC++ hell trying to get freetype2 and the python ft2_interface compiled for windows. Argh. Oh yeah, another thing I noticed is that the Zope profiling seems to break if an xmlrpc call is invoked. Just hangs when it hits the call. Any clues? Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ 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 )