Re: [Zope3-dev] Security Proxy/isinstance
Hi, Dominik Huber wrote: You can use zapi.isinstance (zope.security.proxy orig. place). This function is useful because it works even if the instance is security proxied. I know that from irc but there are two issues: -Fixing that in foreign code is dirty and error prone. In my own code i wouldn't have a problem with it. -Why not fix it in the proxies if the problem can be solved? Thats the way much more clean way i think. You don't want to learn new ways, if the old ones can be made compatible. For now i fixed that through monkey patching, but i don't like that. Andres Freund ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Security Proxy/isinstance
Hi, I'm working with the combination of Zope3 and sqlobjet over sqlos and discovered a problem (about SecurityProxy as i already asked about in #zope3-dev). Some code in sqlobject is using isinstance() to decide what to do. The problem is, that sometimes sqlobject gets securityProxied objects from Zope, which theoretically is no problem. But in praxis it uses isinstance and the SecurityProxy doesn't cooperate with that. Now i searched a bit in the web and discovered, that according to this: http://mail.python.org/pipermail/python-bugs-list/2003-February/016098.html it should be possible to make the Proxies a bit more transparent. Did i understand that correctly? I dont understand to much about python and especially about zope, but i think, that should be the way to go, or am i mistaken? After a short look at _zope_proxy_proxy.c i think that this shouldn't be too hard to implement (although i never touched the python c bindings before, so it not unlikely that I'm mistaken). Andres Freund ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Changing zope.app.rdb to better support sqlos
Hi, im using sqlos with zope3 which is for itself no problem. People who worked with sqlos might know, that you have to change an adapter in sqlos's configure.zcml acording to which database you use. This is so, because sqlobject, on which sqlos is built up, has to know which database it uses as it generates SQL for them. So no alternative i see can change the fact, that it has to know which database is used. I see four possible solutions to this: 1. Move sqlobject into zope.app.rdb/into the database connectors. While this would open some neat possibilities, i dont think anybody will see this as an real possibility, as it is bloat and way too much work. 2. Have sqlos extract which database is used out of the classname of the connection. This works (it is working in a branch now), but is not very elegant, propably failure prone, and doesnt use zope addaption, but the database adapters doesnt have to be changed. 3. Have ever single adapter reimplement some type method. This would work, but would still not use zope adaption and all database adapters would have to be changed. 4. Every database adapter has an own interface which inherits from the zope one. This would enable the use of normal zope adaption which i would prefer, but again every adapter which should be used together with sqlos has to be changed. There is also one other problem. Sqlobject needs to have the database module in order to do binary uploads and other things. But as far as i looked i cant extract that one out of the zope.app.rdb adapter, or? Wouldnt it be better if the database module would be provided in .module or something? Andres Freund ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com