Re: [Zope-dev] RedstrictedCreation proposal
Toby Dickenson wrote: > (Ive CCed everyone who has commented on the proposal; I hope thats OK) Could everyone stick to zope-dev only? One copy of each email is enough ;) ___ 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] OpenSSH configuration between ZEO clients & storageserver
Shane Hathaway wrote: > But you don't need reliability compensation to multiplex. SSH assumes > the transport layer is reliable. So an SSH tunnel and an SSL tunnel are > virtually synonymous. They're not really, but yeah, I was wrong :) A SSL forwarder takes a packet, and then sends over another TCP connection that happens to be encrypted. It's basically a TCP port forwarder. Multiple client connections through the local SSL forwarder (e.g. stunnel) will run over *multiple* outgoing streams: client --> stunnel on localhost ---> stunnel on www.foo.com > server on www.foo.com SSH OTOH uses a multiplexing protocol, where multiple streams of data run over the same connection, and each have their own flow control. Multiple client connections over a SSH port forwarder will run over the same *single* stream. A third thing is TCP over TCP, i.e. PPP over SSH or SSL, which functions as a full network connection. > The Python standard library has good support for an SSL client but not > for an SSL server. pyOpenSSL is good for both servers and clients. Could be better, but it's easy to start using it, especially for select() based servers (its thread-safety is iffy). Twisted's SSL stuff uses it, and latest version of pyOpenSSL may have asyncore example. ___ 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] OpenSSH configuration between ZEO clients & storage server
Toby Dickenson wrote: > but ssh port forwarding is only one layer of TCP. ssh port forwarding > is good. I'mp pretty sure it's TCP over TCP (ssh protocol does multiplexing). SSL OTOH is not TCP over TCP. ___ 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] OpenSSH configuration between ZEO clients & storage server
Adam Manock wrote: > For a look at why TCP over TCP is a bad idea, (e.g. ssh port forwarding) > > see: http://sites.inka.de/sites/bigred/devel/tcp-tcp.html > > For a solution, see: http://sites.inka.de/~bigred/devel/cipe.html That may be true, but it also means that you need to hook in at the kernel level, if I'm not mistaken. ___ 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] OpenSSH configuration between ZEO clients & storage server
Or you could wrap ZEO traffic with SSL using stunnel or a similar program, assuming they allow restriction of traffic based on client certificates. This doesn't have the drawbacks of SSH or VPN. ___ 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 & Cygwin
> The only thing in Zope for Windows that uses the registry is the installer > and the service manager and we don't use the winreg module in the current > install or service process, AFAIK. It is handy, however, to know it can be > used under Cygwin with your patches. Note that cygwin is GPL, and since ZPL isn't GPL-compatible... (/me waves to kapil): "The Cygwin API library found in the winsup subdirectory of the source code is also covered by the GNU GPL. By default, all executables link against this library (and in the process include GPL'd Cygwin glue code). This means that unless you modify the tools so that compiled executables do not make use of the Cygwin library, your compiled programs will also have to be free software distributed under the GPL with source code available to all." Phillip Eby's suggestion of using mingw is therefore more practical, since that links against MSVCRT and is compatible with standard Windows python. ___ 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] A modest proposal: Replace medusa with Twisted
Phil Harris wrote: > That said, I think JPE/PJE is the best way forward, but this problem needs > to be solved (if it hasn't already). Latest CVS README says: Multithreading == Multithreading issues are taken care of. There is still a known issues concerning process termination (non-deamonic thread hang out) that can require that the process be interrupted or killed explicitely. Some more work need to be done on process termination and cleanup conditions of the virtual machines. ___ 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] A modest proposal: Replace medusa with Twisted
kapil thangavelu wrote: > twisted is GPL and zope is not gpl compatible and that does not appear to be > changing despite some mention from zc about trying to achieve compatiblity. Twisted is LGPL, and it might be possible to license it under something that will work with ZPL. I don't think this will be an issue if it comes to it. ___ 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] A modest proposal: Replace medusa with Twisted
Andreas Jung wrote: > The Medusa architecture is also more or less generic and extendable. 1) I've talked to at least one person who had trouble integrating an external protocol into Zope, and ended up running it as a seperate process and communicating over XML-RPC. 2) Plugging in a different transports instead of TCP (e.g. SSL) is much easier in Twisted than medusa, as far as I can tell. In m2crypto's medusa ssl code very protocol needs its own subclass in order supports SSL. In Twisted that is done transparently - the protocol doesn't have to worry about the transport. Basically any protocol (excepting perhaps FTP) could run out of the box with SSL in Twisted, using the one SSL support module. Or Unix domain sockets for that matter :) 3) Twisted provides a larger number of protocols out of the box (e.g. pure python LDAP client, AOL TOC, IRC, POP3, SMTP, telnet) than medusa. Hopefully we will soon have an integrated DNS server as well, though I can't think how *that* would help Zope. Twisted does not use asyncore, if that's what you mean when you say it will have the same problems as medusa. ___ 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] A modest proposal: Replace medusa with Twisted
Tino Wildenhain wrote: > this sounds good for me. One would have to see it > in the wild. Would you be able to do a sample integration > for testing? > It's not that I actually have the time for it, nor do I have enough knowledge of Zope's medusa integration. I was rather hoping someone from DC would try it :) ___ 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] A modest proposal: Replace medusa with Twisted
[EMAIL PROTECTED] wrote: > Any ideas what the performance would be compared to medusa? Nope. However, it is pretty fast, and Zope is slow anyway, since it's so dynamic. >>4) Good integration with threads - while event based, twisted has a very >>nice model for dealing with threaded apps. >> > What benefits would this really give? What drawbacks would we have to deal > with? Overall I have noticed that python does not seem to actually thread > very well since there is that global lock. I'm not sure how ZServer does it, but mixing asyncore and threaded apps isn't fun, to say the least. > This part sounds pretty cool I will definitely have to look at it some > more. I looked at it a little while ago and it looked very cool however > zope has some serious things that twisted does not. Mainly I really like > how the access control system works, the user folder system and the object > store. Which is why I said we should stay with Zope's current stuff and not build on twisted's own high level web package, just it's low-level HTTP support. > We could essentially keep the ZMI however I do think the ZMI is due for a > large rewrite soon. I'm not saying anything about the ZMI - if done correctly people would never know medusa was replaced, since this is a very low-level part of 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 )
Re: [Zope-dev] A modest proposal: Replace medusa with Twisted
Phil Harris wrote: > I'd say the fact that it doesn't work on Win32 is a bit of a downer. Last I checked twisted ran fine on win32. ___ 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] A modest proposal: Replace medusa with Twisted
Chris Withers wrote: > Well, you're advocating this, so it's fair to paint a rosy picture. And I'm a Twisted developer, so I'm even more biased :) Though the overall design was not done by me, and was what convinced me to use it in the first place. > Can anyone see what the downsides would be? 1) Medusa is working *now*. This is of course the main reason why not to switch. I dunno how deeply integrated Zope is with ZServer. 2) Twisted has not hit 1.0 yet. OTOH the core APIs Zope would be using are pretty stable and I don't think we are that far from 1.0. > In any case, it does look cool. Perhaps a fishbowl proposal would be the way to > go? After I get some downsides, I might. ___ 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] A modest proposal: Replace medusa with Twisted
Oops, forgot the URL: http://www.twistedmatrix.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 )
[Zope-dev] A modest proposal: Replace medusa with Twisted
Actually, this brings up this idea I had - Zope should replace medusa with Twisted. Why, you ask? 1) Twisted separates transport from protocols, and the event loop it uses is extendable and generic. That means: - It can run on Jython (using threads, someday with java.nio), and it can be integrated with the Tk and GTK event loops. - Your protocol doesn't have to worry about the transport - Twisted supports SSL, TCP and unix domain sockets right now, without having to make any change to the protocols. 2) Twisted is designed to run multiple servers and protocols at the same time, and these can be changed at runtime. It already includes pure python support for HTTP, FTP, LDAP, SMTP, POP3, DNS, telnet, AIM TOC, and IRC, all integrated with the main event loop (all have server support except DNS and LDAP). Adding new protocols to Zope is not easy, at the moment. 3) Twisted is being actively developed and extended. medusa less so. 4) Good integration with threads - while event based, twisted has a very nice model for dealing with threaded apps. 5) Twisted has Perspective Broker, an async.ready remote-object protocol that supports caching, object migration, and remote messaging, with integrated authentication and authorization. And it ideologically meshes with the "object publisher" notion in Zope. No, really :) Twisted already includes a high-level web framework, but Zope probably would not use it, and instead build its own on top of twisted's low-level http support. ___ 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] Local Factories in Products
Chris Withers wrote: > > In ZClasses it is possible to control where a ZClass instance > > should be permitted to be added, in other words show up > > in the factory listing in a ObjectManagers manage_main view. > > Didn't Itamar have a proposal/project on this? It's still unimplemented - you can view the details at http://dev.zope.org/Wikis/DevSite/Proposals/RestrictedCreation, and there's some implementation suggestions from Jim Fulton in the discussion area. -- Email: [EMAIL PROTECTED] Web: http://itamarst.org ___ 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] Keyword Indexes causing Keyerrors
Here's what was causing my KeyErrors, and how I solved it, and why I think KeywordIndexes broke. I have a keyword index on the "categories" property of my CatalogAware object. "categories" is a list. def manage_removeItems(self, ids=[]): """ Remove listed items from this category """ for id in ids: ob = getattr(self.Items, id) categories = ob.categories # <-- this is the problem categories.remove(self.uid) ob.manage_changeProperties(categories=categories) ob.reindex_object() I solved the problem by switching the problem line to say "categories = ob.categories[:]". What does this mean? I was mutating the same list that was attached to the object. Doing this caused the Keyword Index to break. I assume the reason then is that the index somewhere stored a reference to the "categories" property, not a copy. This means that when I mutated ob.categories, I was also mutating the contents of the index, causing it to get screwed up. The solution would be that keyword indexes store a *copy* of the property they are indexing, not a reference to it. If I'm not mistaken, that means changing line 42 in UnKeywordIndex.py (2.2.4 version) from: unindex[i] = kws to: unindex[i] = kws[:] Although use of deepcopy may be a better idea? -- Email: itamar(at)shtull-trauring.org Web: http://itamarst.org ___ 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] Keyword Indexes causing Keyerrors
Christopher Petrilli wrote: > Are you getting KeyErrors or are you getting log messages complaining about > keyts not existing? KeyErrors - the logging says: 2000-12-20T16:33:00 ERROR(200) UnKeywordIndex unindex_object could not remove 3 from set -- Email: itamar(at)shtull-trauring.org Web: http://itamarst.org ___ 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] Keyword Indexes causing Keyerrors
I'm getting tons and tons of keyerrors when making changes to a catalogaware object's keyword index and then reindex_object() it. Alternatively, the Catalog doesn't get updated at all. Is there any way to prevent this from happening, other than upgrading to 2.3? -- Email: itamar(at)shtull-trauring.org Web: http://itamarst.org ___ 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, MySQL, Full Text Searching
Chris Withers wrote: > I've read that ZPatterns and ZCatalog don't interact too well and I was > wondering if this is also true of the new ZPatterns release. I might be > looking to move something to ZPatterns so that it can get all benefits > of Zope's security system and things like the Catalog, obviously if the > Catalog doesn't work with ZPatterns, that's a bit of a problem :-S CatalogAwareness and DataSkings don't work together. However, I wrote and stevea maintains a replacement, for DataSkins, thats better than CatalogAwareness - it automatically recatalogs when the object changes - no more reindex_object() calls. The product is DataSkinAddons. Older version of ZPatterns didn't support subtransactions - newest version does, so it should work fine with ZCatalog. -- Itamar S.T. [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] Another caching scheme...
Carlos Neves wrote: > But that just isn't enough... though it works for a specific caching scheme, > it's not a site wide, or should I say, server wide. Mindstorming with my fellow > workers, one (the boss, and that's why he's the boss) came up with the magic > words... cache the html on it's way out and make some callback on request to > test if we have that particular request in store. So I did... Um, what you're describing is already supported using HTTP caching headers. Set up Apache as a reverse proxy, give Zope the appropiate header handling code (I posted how on Zope-dev a while back) and you'll get wonderful speed up without messing with Zope's internals. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Adding properties in __init__
Chris Withers wrote: > self.manage_addProperty('AProperty','1\n2\n3','lines') > I'm guessing that this is because self isn't an acquisition wrapper in > __init__ (even though SimpleItem is Acquisition.Implicit) but what am I > supposed to do to add a property in __init__? I usually override _properties in the subclass, with the new property definition, and then doing self.Aproperty = '1\n2\n3' works nicely. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Fw: 2gb file size
Shane Hathaway wrote: > Not long ago I created a wrapper around File objects which automatically > splits the file before it reached a predefined limit. It could handle > any number of partitioned file segements. Yes please! Perhaps it could be integrated into the ZODB codebase while you're at it? ___ 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] ZClasses not copyable - why?
Philipp Auersperg wrote: > in ZClass I have found a nice-sounding method _setBasesHoldOnToYourButts() , > and the source is commented with '#Eeeek', h > > What are the risks for a good shot into my foot using this function? If your new base classes requires some variables to be initialized in __init__, older instances may not work since they won't have them, and other similar problems. I've done this before, when I really had to - usually nothing bad happens. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Fw: 2gb file size
Shane Hathaway wrote: > Are you running Zope 2.2.1 or later? There were pointer arithmetic > errors that occurred on earlier versions, even with operating systems > that support >2 GB files. So on W2K, Zope can have >2GB databases? I'd really like to hear if you get it to work Andy (or if anyone else did.) -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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 + Skinscript
"Phillip J. Eby" wrote: > DataSkin is strictly a mix-in class. Sometimes I forget to remind people > of that, and sometimes I even forget it myself. :( DataskinAddons provides a nice DataSkin-derived class for debugging purposes - it has a debug() method that prints out __dict__, and lets you getattr attributes through the web as well. So you can use that for testing purposes. http://www.zope.org/Members/stevea/DataSkinAddons -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Latest ZPatterns stability
How stable is the latest ZPatterns beta? I'd like to put up a site using it, but I'm still kinda wary of doing it. Admittedly, I ahven't had any TransactionErrors since upgrading. Has anyone had them? Or are the transaction problems solved? That's what worries me most, since it takes down all of Zope with it. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Flat Database/ZPatterns api, performance ?
Simon Michael wrote: > Flat Database (was ListMate) is just what I need to whip up an > interface for non-technical administrators - thanks. So I migrated two > data tables ("workshops" & "registrations") from gadfly to flatdb > instances using the CSV import feature, and the admin interface is > working fine. I wrote flat database because I wanted some features ListMate didn't have and didn't want ZClasses. I basically copied the structure from ListMate, so it's probably not the best design possible for ZPatterns. So (1) may not be possible with the current code. Maybe try creating entries like so: ... manage_addEntry doesn't return the new entry. Idon't remember how this works anymore, frankly. The source code is your friend :) -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Unique and Contant object IDs
Johan Carlsson wrote: > > > Why are the _p_oid depriciated? > > > > Not depreciated, just "don't use them." > > But I want too, why shouldn't I? > They solves my problems with mapping relational data to objects. I would guess multiple databases can have the same oid's for their objects - and Zope does support multiple databases. Plus you're breaking encapsulation, using an implementation detail of the ZODB for other purposes. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Unique and Contant object IDs
Johan Carlsson wrote: > Why are the _p_oid depriciated? Not depreciated, just "don't use them." -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Unique and Contant object IDs
Chris Withers wrote: > > I suspect you will have to build this yourself. Store a sufficiently random > > id inside your objects when they are created, and use a ZCatalog to index > > them. > > blech! ;-) This is the normal way to keep references to objects. I asked Jim Fulton at IPC8, and he basically said "don't use _p_oid", which means this is the only way. Of course, once the observer interface is more well developed you won't need the Catalog part. > CatalogAware is the work of the devil anyway ;-) ZPatterns ahs got to be > better for doing that kindof stuff ;-) Yup - no object_reindex() every time you change the object, no need to inherit from anything. You can have automatic catalogging in any DataSkin object trivially, with no change to your class. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] extending objectValues() and objectIds() or ?
Write a Python Method (install the PythonMethods product first) called say, publishableObjectValues that does that: self # functions that returns publishable objects result = [] for o in self.objectValues(): if o.isPublishable(): result.append(o) return result -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Observer Interface
In order to make Shane's Symlink product (soft links to objects based on path) really usable, some sort of Observer interface is necessary. I know there was some discussion of implementing this in the Interfaces wiki and in zope-ptk. Did anything ever come out of this? Or was it never implemented? -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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.... more thoughts about implimentation of a concrete system...
Steve Spicklemire wrote: > (3) Has anyone found a better way to adorn 'plain' objects with methods? An AttributeProvider? -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Adding functions to _
I'm using CVS Zope, and I want to add a function of mine to _, so I have the following code in a Product's __init__.py: from log2vis import log2vis from DocumentTemplate.DT_Util import d d["log2vis"] = log2vis However, when I call the function, I get an error about DocumentTemplate, from which I discovered that when I call _.logvis('a_string'), instead of the string being passed as the first parameter, _ is passed as the first parameter to my function, forcing me to truncate it when calling log2vis: from log2vis import log2vis from DocumentTemplate.DT_Util import d def log2vis_wrapper(*args, **kwargs): return apply(log2vis, args[1:], kwargs) d["log2vis"] = log2vis_wrapper Any idea what could cause this strange behaviour? it doesn't happen for other functions inserted into _ in DT_Util.py. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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: Problem 1: HTTP and HTTPS (more of a proxypass issue)
Chris Withers wrote: > What difference does it make if you do REQUEST.setVirtualRoot('/',1)? This might actually solve most of my problems, since it deletes the parents I don't need from PARENTS. However, when I do this I can't view anything - it keeps raising Unauthorized. Setting the permissions to not acquire and be explicitly on does not help. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Virtual Hosting in 2.2 - a Bestiary of Buglets
I setup virtual hosting on Zope 2.2.1 with SiteAccess 2. I used Apache with ProxyPass (Apache acting as a reverse HTTP proxy in front of ZServer) instead of FastCGI, since this is much faster (with caching headers apache is about 10 times as fast as ZServer). The setup is as follow - each site has a folder in /websites, so www.example.com is mapped to /websites/example in Zope. In /websites/example I have an Access Rule that tells Zope that the base url is http://www.example.com. Problem 1: HTTP and HTTPS (more of a proxypass issue) === I want to be able to serve both http and https versions of a site from Apache. Problem is, because of the way proxying works, there is no way for Zope to know if it is origially being accessed via http or https. My solution? Add a folder in top level of Zope called "ssl". If we see our path as proxied by Apache is /ssl/websites/example, we know we are being accessed via SSL. Because of the magic of acquisition, this works, but it's still an ugly hack, and slows things down. Here's the SiteAccess rule I used: if REQUEST['PATH_INFO'][:5] == '/ssl/': REQUEST.setVirtualRoot('/') REQUEST.setServerURL(protocol='https', hostname='www.example.com', port='443') else: REQUEST.setVirtualRoot('/') REQUEST.setServerURL(hostname='www.example.com', port='80') Problem 2: ZCatalog = All the objects in /websites/example are being catalogged with paths such as /websites/example/folder/myObject. However, when I gets the objects path using getpath(), it's not adjusted based on the virtual hosting settings - it's still /websites/example/folder/myObject, not /folder/myObject as it should be. Problem 3: Management interface = The breadcrumbs in the folder management screen (e.g. "/ folder1 / folder2"), still show the "/ websites / example", with links, when using the virtual hosting. That is, the managemnt interface shows folders that we are not supposed to be able to access when we are using virtual hosting. Problem 4: Access to other virtual hosts (security issue?) When using virtual hosting, it is still possible to access the /websites folder for example, using acquistion. So I can view the contents of one website from the other: www.example.com/websites/example2, and www.example2.com/websites/example. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] remote procedure calls to manage functions
Jim Fulton wrote: > > It's not really favored, both are quite useful. xml-rpc is more for > > when you want two different system to interoperate. ZClient is very > > zope specific and probably gives you a bit more functionality than > > xml-rpc (because it has the 'remote object' abstraction). > > I don't think ZClient is really Zope specific. At least > it's not supposed to be. It does have a richer API, including > features like authentication and header support. The problem I have with ZClient is that the result of method calls is always a string - while with XML-RPC I can get lists/dictionaries/integers, if that's what the method returned. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Server Side Trojan Issue really dead?
Steve Alexander wrote: > Another simpler solution is to make all the pages unowned, make new > pages unowned, and make them remain unowned even when edited. I think "unowned" in 2.2 is the like the 2.1 behaviour - executes at the privilige level of the viewer. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Quickie on ZPatterns ... I promise :)
Bill Anderson wrote: > > Let's say I have an object I will store in a rack. Let us say I want this object to >be > cataloged in a ZCatalog. Any caveats I need to know about > ..such as "Don't do that!" ? > ?;^)= You can't have them inherit from CatalogAware, you'll need to use a trigger that does this for you. I'm uploading a Product that gives this capability - and unlike CatalogAware, it recatalogs *automatically* whenever the object changes. No more object_reindex! (I only tested extensively with DataSkins, though). http://www.zope.org/Members/itamar/ZPAddons -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Use ZODB3 and ZCatalog for indexing purposes
Phil Harris wrote: > Have you seen the Zope on CDROM howto? > > Try searching on zope.org (when it's back up that is) for it. I don't think it's relevant actually. WHat you do want is Jim Fulton's talk about ZODB from IPC8 - search zope.org for that. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Intializing the objectsformerly-known-as-RackMountables
"Phillip J. Eby" wrote: > >Doing self.__dict__['name'] = 'Rincewind' seems kinda ugly. Maybe newItem > >should by default call a function on newly created objects, say __init? I > >don't want to have to subclass Specialist (or in my case, LoginManager) each > >time I want to this, since it's a *very* common action. For example, > > Could you give a more specific example? My assumption is that if you need > to have things happen upon adding, that one uses a trigger to do it. Or, > if the data is specific to that instance, then the appropriate thing would > be to manipulate properties or attributes in the code that calls newItem(). I like the OO idea that changes to an object should be done by the object, not by someone else. It seems silly to have to write a trigger to do this, or a factory. Why do classes have __init__ anyway? So that all the internal object creation logic is in the same place. Okay - this is the ASP Account class. These are user objects that I'd like to store in a regular LoginManager. I could subclass LoginManager of course, but I don't want to spread my code all over the place, when there's no real need. class ASPAccount(LoginUser, MemberMixin): def __init__(self, id, title=''): LoginUser.__init__(self, id) self.__dict__['_currentPayment'] = None self.__dict__['debt'] = Payment.Debt(0.0) self.__dict__['debtInPayment'] = Payment.Debt(0.0) self.__dict__['services'] = ServicesManager.ServicesManager() self.__dict__['lastMonthlyPayDay'] = None # day in month on which we pay self.__dict__['payday'] = 15 self.__dict__['log'] = "" > Also, it isn't necessary to subclass the specialist -- you don't have to > call your routine newItem(), after all. newUser() would be a better choice > of name for the method, it sounds like. Again, why should I fagment my class into multiple parts? I want it all to be in once place - it's more readable, easier to debug, easier to understand, and more portable. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Another ZPatterns bug
(ZPatterns 0.4a5, Zope 2.2.0) If an agent raises an exception, you don't get to see the traceback. Instead, the object is simply not added (if the exception was in _objectAdded, donno what happens in _objectChanged). This makes debugging agents basically impossible... -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Intializing the objects formerly-known-as-RackMountables
I need to do initialize some properties of new instances of a DataSkin subclass - ASPAccount. However, I can't put this in __init__ since the object hasn't been stored at that point. Doing self.__dict__['name'] = 'Rincewind' seems kinda ugly. Maybe newItem should by default call a function on newly created objects, say __init? I don't want to have to subclass Specialist (or in my case, LoginManager) each time I want to this, since it's a *very* common action. For example, *** Specialists.py.orig Wed Jul 19 12:37:32 2000 --- Specialists.py Wed Jul 19 12:38:18 2000 *** *** 37,43 def newItem(self, key=None): """Create a new item""" # Default use first rack ! return self.rackList[0].__of__(self).newItem(key) def manage_refreshPlugIns(self, REQUEST=None): """Update plugin registries""" --- 37,46 def newItem(self, key=None): """Create a new item""" # Default use first rack ! obj = self.rackList[0].__of__(self).newItem(key) ! if hasattr(obj, '__init'): ! obj.__init() ! return obj def manage_refreshPlugIns(self, REQUEST=None): """Update plugin registries""" ___ 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] Proposed interface: Restricted creation
Toby Dickenson wrote: > I have a beautiful hack to do this for python products.. Which is exatly my point - you should not need to go through hoops in order something so simple. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Proposed interface: Restricted creation
Shane Hathaway wrote: > The place where this is needed most (IMHO) is for ZClass factories. So > there needs to be a way to create meta type filters through the Web. Yes, but in Python products too, where you have Items that should only go in specific ItemHolders. This is very common. > On the other hand, the plugins framework by Phillip Eby solves this > problem in a nice way. I'm hoping to eventually modify the plugins > framework so it's more accessible for ZClass development. Do you have > an application where plugins won't suffice? Not right now - but I'm sure someone will at some point, so why limit yourself? And why limit this to ZClasses only? -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] ZClass inheriting from ObjectManager and DataSkin?
Are there (or better yet, what are) any potential problems here? My gut feeling was that it wouldn't work, but you can at the very least add objects in instances of the ZClass - deleting and renaming don't work though. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Proposed interface: Restricted creation
(URL: http://www.zope.org/Members/michel/Projects/Interfaces/RestrictedCreation) Restricted Creation of Objects The problem - certain types of objects should not be added except in certain places or with certain restrictions. For example, we may want to make sure Laundry objects are only added inside Luggage objects, and nowhere else. Or we may want to make sure that an object is added only if there's a MailHost in it's acquistion path. How do we ensure this? I propose a Restricted Creation Interface - when an ObjectManager constructs it's Add list in manage_main, it first checks with each addable class if it's instances can be added in this specific ObjectManager. We do this by calling a class method called _addableIn(), that receives as a parameter the ObjectManager to which we may want to add objects. If the result is not true, instances of this class can't be added, and won't be listed in the Add list. For example, the following code will make the Laundry class show up in the Add menu only in objectmanagers whose meta_type is "Luggage": class Laundry(SimpleItem): """ A Fruit class """ def _addableIn(parent): if parent.meta_type == "Luggage": return 1 else: return 0 I'm not sure how to get from meta_type to class, so I can't show working code, but something like this in ObjectManager.py would do the trick: def filtered_meta_types(self, user=None): # Return a list of the types for which the user has # adequate permission to add that type of object. user=getSecurityManager().getUser() meta_types=[] if callable(self.all_meta_types): all=self.all_meta_types() else: all=self.all_meta_types for meta_type in all: > klass = getClassFromMetaType(meta_type) > > # If the class has a function _addableIn, it must return true or > # that means the class doesn't want to be added to this ObjectManager: > > if not hasattr(klass, '_addableIn') or klass._addableIn(self): > if meta_type.has_key('permission'): > if user.has_permission(meta_type['permission'],self): > meta_types.append(meta_type) > else: > meta_types.append(meta_type) return meta_types Comments? -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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 alpha 3 released (was re: ZPatterns0.4.0a2 bug fixes)
> Huh? Oh, %()@&%... I fixed that in my working copy, but didn't check it > into CVS before building a release .tgz yesterday... Argh. Line 137 of > DataSkins.py *should* read: Great, it works! Thanks for all the wonderful work, Phillip. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] Bug in Changed events in ZPatterns 0.4.0a1?
As far as I can tell, the first time an object is changed, an Agent's _objectChanged() will be called, but as long as the object is still in the memory cache, _objectChanged() will not be called again. That is, I change an object - _objectChanged() is called. However, the object is now in the memory cache, so the next time I change the object, _objectChanged() is not called. If I flush the cache, or Refresh the Product, the next _objectChanged() will be honored (but the next-next one won't.) Alternatively, I may be misunderstanding something about the way these events work. Another problem I'm having is giving default values to objects (e.g. default UNAPPROVED status for approval). I can do this with a trigger (whith objectAdded being "client.status = UNAPPROVED"), but I also have a trigger that is equivalent to CatalogAwareness. The problem is that I don't know what order the triggers get called - will the changes made by one trigger be consistently cataloged by the other trigger? -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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 0.4.0a1) Getting Customizers to recognize DataSkindescendantsdescendants
I want to customize (with a Customizer) a class I made. It inherits from DataSkin. However, it's meta_type doesn't show in the Customizer's manage_typesForm page, so I can't tell the Customizer to use this class unless I call manage_setTypes manually (which works.) So how come my class won't show up - DataSkin and RackMountable both show up, and my Product isn't broken - I can add instances of my DataSkin descendant. -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ 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] 0.4.0 prerelease snapshot (was zpatterns-0.4 ?)
"Phillip J. Eby" wrote: > > By popular demand, I am releasing a development snapshot of version 0.4.0. > Please see the main ZPatterns download page. Thank you! Also, people might want to know that it includes a nice mixin class that lets you respond to transaction events (rollback, commit). -- Itamar S.T. [EMAIL PROTECTED] "It don't get thingier than that!" ___ 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] Containers in ZODB
Petr Knapek wrote: > Container - object with some attributes and methods which can collect > other objects (also Containers) For these you should inherit from OFS.ObjectManager.ObjectManager. > Item - an object with some attributes and methods which can not collect > any other objects but can be contained in Container For these you should inherit from OFS.SimpleItem.Item. All you really need is to inherit from Persistent, if you're making your own objects, but inheriting from the above will allow you to use them later in an easier fashion. -- Itamar S.T. [EMAIL PROTECTED] "It don't get thingier than that!" ___ 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] Getting to container from a method called by the factory
Kevin Dangoor wrote: > I'm trying to check if the container from which the user selected a > product from the add menu has an "acl_users" folder. When the user selects > the option from the add menu, they get a form. When they submit the form, > the method (a PythonMethod) does this: > > folder=self.Destination() > if hasattr(folder, 'acl_users'): > ...do something... > else: > ...complain... > > Even though I know the folder has an acl_users (and having this function > return folder.objectIds() proves it), the above code will always complain. > Is there a problem with using hasattr in this context? Well, first of all, because of acquisition, if there's a acl_users at the top level this will always return true. Next, PythonMethods have trouble with hasattr AFAIK - so instead do: folder=self.Destination() if 'acl_users' in folder.objectIds(): ...do something... else: ...complain... -- Itamar S.T. [EMAIL PROTECTED] "It don't get thingier than that!" ___ 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] New Help System in 2.2
"Dan L. Pierson" wrote: > You might want to take a look at the bottom of http://www.lfw.org/python/... He finally released it! I've been waiting for this since IPC8. -- Itamar S.T. [EMAIL PROTECTED] "It don't get thingier than that!" ___ 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] HappySession 0.1.0 released!
Hung Jung Lu wrote: > I have been using RAM-based session management for a while, but never wrote > a product for it. Since Graham Chiu has mentioned it again about making a > real product, I have taken the time to make one, and called it HappySession. > :) Well, in short, it uses cookie for session id, you specify a maximum > session expiration time, and expired session data are automatically deleted. > It's Zope-transaction-aware. I'd be very grateful for a description of how you built the session server in combination with persistence, transactions, and the fact that each thread has it's own copy of data. If I understood correctly, the references to the server are stored in the class (which I assume is global for all Zope threads.) -- Itamar S.T. [EMAIL PROTECTED] "It don't get thingier than that!" ___ 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] CatalogAwareness for RackMountables
Sorry if this arrives twice, but mailing lists seem to have swallowed my earlier mail. I've been playing around with ZPatterns, and I must say it's very cool - finally you can mix ZCatalog and SQL storage. CatalogAwareness is slightly different than regular Zope objects in that you have to find the ZCatalog in the Rack's acquisition path, but that's about it. The absolute_url function I define here should be moved to the RackMountable class since it may be useful in other situations. - from Products.ZCatalog.CatalogAwareness import CatalogAware from Products.ZPatterns.Rack import _v_rack, RackMountable class RMCatalogAwareMixIn(CatalogAware): """ CatalogAwareness for RackMountables. You need to inherit from this class before RackMountable. Objects are NOT automatically indexed, because no rack has been defined when we're in __init__. """ def absolute_url(self, relative=0): """ URL for catalog-awareness """ return "%s/%s" % (self._v_rack.absolute_url(relative), self.id) def index_object(self): """A common method to allow Findables to index themselves.""" if hasattr(self._v_rack, self.default_catalog): getattr(self._v_rack, self.default_catalog).catalog_object(self, self.url()) def unindex_object(self): """A common method to allow Findables to unindex themselves.""" if hasattr(self._v_rack, self.default_catalog): try: getattr(self._v_rack, self.default_catalog).uncatalog_object(self.url()) except: pass def manage_delete(self, _v_rack=_v_rack): """ Uncatalog this object and then delete it """ self.unindex_object() return RackMountable.manage_delete(self, _v_rack) ___ 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] CatalogAwareness for RackMountables
I've been playing around with ZPatterns, and I must say it's very cool - finally you can mix ZCatalog and SQL storage. CatalogAwareness is slightly different than regular Zope objects in that you have to find the ZCatalog in the Rack's acquisition path, but that's about it. The absolute_url function I define here should be moved to the RackMountable class since it may be useful in other situations. - from Products.ZCatalog.CatalogAwareness import CatalogAware from Products.ZPatterns.Rack import _v_rack, RackMountable class RMCatalogAwareMixIn(CatalogAware): """ CatalogAwareness for RackMountables. You need to inherit from this class before RackMountable. Objects are NOT automatically indexed, because no rack has been defined when we're in __init__. """ def absolute_url(self, relative=0): """ URL for catalog-awareness """ return "%s/%s" % (self._v_rack.absolute_url(relative), self.id) def index_object(self): """A common method to allow Findables to index themselves.""" if hasattr(self._v_rack, self.default_catalog): getattr(self._v_rack, self.default_catalog).catalog_object(self, self.url()) def unindex_object(self): """A common method to allow Findables to unindex themselves.""" if hasattr(self._v_rack, self.default_catalog): try: getattr(self._v_rack, self.default_catalog).uncatalog_object(self.url()) except: pass def manage_delete(self, _v_rack=_v_rack): """ Uncatalog this object and then delete it """ self.unindex_object() return RackMountable.manage_delete(self, _v_rack) ___ 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] Problems with RackMountable
I'm adding some RackMountable objects (subclassed from RackMountable and SimpleItem.Item) and when I try to access them via URL I get an AttributeError like they don't have attribute __of__: Traceback (innermost last): File /hd1/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /hd1/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /hd1/zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ElementWithAttributes) File /hd1/zope/lib/python/ZPublisher/Publish.py, line 151, in publish File /hd1/zope/lib/python/ZPublisher/BaseRequest.py, line 308, in traverse File /hd1/zope/lib/python/Products/ZPatterns/Specialists.py, line 27, in __bobo_traverse__ (Object: SheetProviderContainer) File /hd1/zope/lib/python/Products/ZPatterns/Specialists.py, line 39, in getItem (Object: SheetProviderContainer) File /hd1/zope/lib/python/Products/ZPatterns/Rack.py, line 515, in __get_attr__ (Object: cheese4) AttributeError: __of__ What am I doing wrong here? -- Itamar S.T. [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] Preprocessed Output
A common pattern when developing in Zope is to have a sort of Document that contains text with some special codes, and then to render them and return the output to the user. So we have DTML Documents, and Structured Text Documents, and Python Methods, and I've written a few for my own use and I'm sure other people have. Has anyone thought of making this into some sort of generalized superclass that does this sort of I thing. I remember Michel Pelletier worked on something like this and was telling me about it at IPC8. Any code written for that? -- Itamar S.T. [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] DTML tag creation.
Bill Anderson wrote: > I am about to dive into a custom tag, it will be a 'container' tag. > I have seen the HowTo, and it really isn't that clear when you get to > the container tag info. > > Can anyone provide a better rundown? Anyone have a custom tag they > would mind sharing for perusal? > Just trying to save myself sometime. Not a container tag, but check out http://www.zope.org/Members/noa/SpellChecker - me and Noa wrote this a while back. A spellchecker interface written in DTML is not a pretty sight, but you do learn DTML really quickly :) -- Itamar S.T. [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] [Fwd: ZCatalog.. Again.. I know..]
Chris Withers wrote: > I'm not even going to try and guess which is right, all I know is that I > haven't made either change yet and I'm getting an unacceptable number of > incorrect search results in stock 2.1.6 and would like to sort it out... You're using 2.1.6? That's something different. The KeyErrors bug only appeared in CVS ZCatalog - the partial searching version. So it must be something else - and for all I know this bug is fixed in CVS. -- Itamar S.T. [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] Problems with LoginManager form-based login
"Phillip J. Eby" wrote: > Make your root acl_users a LoginManager, with the loginForm there. > LoginManager will only allow "Anonymous" to log in if it is the root > acl_users. This is how standard user folders behave, and *have to* because > of the way manage_workspace works, unfortunately. Until/unless a new login > protocol is worked out in Zope, this is the workaround. But this user isn't even supposed to access manage_workspace - I just need it to access a PTK join_form so it can become a member. I tried making loginForm on the top level display a dtml method customLoginForm (which contains the actual form), and then override it in the PTK folder, but it doesn't - it displays the one on the top level. And I can't use the same loginForm in the whole site, because I may have few portals, and I need the login form to say "if you are not a member you can join here". Any ideas? -- Itamar S.T. [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] ZCatalog and Unique IDs
Chris Withers wrote: > Itamar Shtull-Trauring wrote: > > What happens when you have multiple ZODBs? Additionaly, this breaks > > encapsulation between the ZODB and applications built on it, which isn't > > such a good idea. > > Good, it was a stupid question. :-) Not so stupid - I had the same discussion at IPC8 with me on the asking side. > I guess when you catalog objects, you should make sure you use the REAL > path identifier though, not one that's been mangled by virtual hosting. > > Hence the traversal interface? Right. -- Itamar S.T. [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] ZCatalog and Unique IDs
Chris Withers wrote: > I hope this is a stupid question but why does ZCatalog use the URL of an > object to uniquely identify it? > > Why not just use a reference to the object? Persistent object > identifiers must exist for the ZODB so why not use them instead? What happens when you have multiple ZODBs? Additionaly, this breaks encapsulation between the ZODB and applications built on it, which isn't such a good idea. -- Itamar S.T. [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] Log-parser
"Morten W. Petersen" wrote: > > I'd like to parse the var/Z2.log file, and being a bit lazy, I just tried > to slap in an Apache log-parser utility. This doesn't work however, > are there any utilities that can? AFAIK it's compatible with Apache's log format. Most any log ananlyzer will work - I like and use webalizer: http://www.webalizer.org -- Itamar S.T. [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] Problems with LoginManager form-based login
I add a folder, with a LoginManager in it, define Cookie Auth as only authntication. Now, every time I try to view the folder I get the loginForm asking me to login, even though Anonymous has permissions to view the pages. If I delete the loginForm this doesn't happen, I can view the page with no problems. How do I get the loginForm to appear only if the user doesn't have enough permissions? -- Itamar S.T. [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] [Fwd: ZCatalog.. Again.. I know..]
"R. David Murray" wrote: > It had better be . It's also a one line fix to Lexicon.py. > Mike posted a note explaining the fix and how to retrofit it into > an existing site (you have to clear and rebuild the Lexicon, so > it becomes a little more than a one line fix). If you can't find > the message in the mailing list archives, I can probably did out > a copy I saved somewhere... Last I heard, this bug fix did NOT fix the key-error problem. We are still getting lots of them (but it may have been fixed since in CVS. Michel?) -- Itamar S.T. [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 Wiki updated
"Phillip J. Eby" wrote: > > FYI, the ZPatterns Wiki at: > > http://www.zope.org/Members/pje/Wikis/ZPatterns/ Ooh, this is cool stuff. At what version would it be resonable to start implementing software using ZPatterns? Will there be major changes in the way things work up to 1.0? -- Itamar S.T. [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] Distributed ZODB-Transactions
Shane Hathaway wrote: > Data.fs is essentially a log file that is appended with binary data. > The only time the data is changed rather than appended is when you pack > the database. Therefore, it may be easier to write a script that > catches the data that is appended and appends it to the backup file. > When the script detects the file has shortened (after a packing > operation), it should copy the whole file over. Someone alreay wrote a script that does this - search the archives or zope.org. -- Itamar S.T. [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] Methods through the Web (security?)
Chris Withers wrote: > PS: The XML-RPC stuff could just be given the nwe view permission for > objectIds, if it REALLY needs it... although this would mean the > docstrings thing would have to eb replaced, which isn't necessarily a > bad thing ;-) Yes, it really needs it. My XML-RPC uploading interface to Zope needs to know what's in a folder - so it needs objectIds. How else am I supposed to browse through the Zope tree? I could have users install a method, but this is a very generic need (browsing the object tree) and should be built in. -- Itamar S.T. [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] Zope and SMP
Thilo Mezger wrote: > yesterday, i have test-driven zope on a dual-pentium smp-machine > running linux 2.2 and i was very disappointed by the results. > the zserver threads are running on both cpu's but it seems to > scale really, really badly. i have only done some very cheap > benchmarking but it seems that a single cpu is faster than 2 cpu's. Python has an interpreter lock that can really slow things down on multiprocessor computers, or so I've heard. ZEO will solve this problem by letting you run two instances of Zope on the same machine - check out the ZEO Wiki on zope.org. -- Itamar S.T. [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 )