Re: [Zope-dev] IMPORTANT! Zcatalog path handling changes in 2.3
Christopher Petrilli wrote: On 12/18/00 4:24 PM, "Steve Alexander" [EMAIL PROTECTED] wrote: Doesn't work with 2.3 from CVS, 2000-12-18 21:21 UTC I had the same problems with 2.2.5b1... ACK, I forgot that I also revealed afew bugs in other systems :/ I thought that I could just package up Zcatalog, but apparantly not Let me work on coming up with something new. Has any progress been made on this yet? cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Updating a ZCatalog when objects in it change their path
Chris Withers wrote: However, the only way I could find to solve it was to add a manage_afterAdd method to Squishdot Sites which recatalogued all postings. This is a _lot_ more resource intensive than it needs to be, since I don't actually want to recatalog all postings (quite expensive when there are 3000+ of them ;-), I just want to modify the paths that ZCatalog has stored. Is there any way to do this? There probably should be ;-) Look in the new ZCatalog product (released for testing a few weeks ago), in the manage_normalize_paths method of ZCatalog.py (line 603). This method goes through every item in the Catalog, and checks to see if its path needs to be changed to the new convention of using the physical path to the object. You could use a modified version of this method to do what you want, calling it from manage_afterAdd. You may need to store the old path to the ZCatalog instance in an attribute, so you'll know how to change the paths. The following code should help, although I haven't tested it. It is shamelessly cribbed from Chris P's manage_normalize_paths method. paths = self._catalog.paths uids = self._catalog.uids for path, rid in uids.items(): new_path=_method_to_return_new_path_after_add(path) del uids[path] paths[rid] = new_path uids[ppath] = rid -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Updating a ZCatalog when objects in it change their path
cheers :-) if people start bitching that it's too slow, I'll give this a go... Chris Steve Alexander wrote: Chris Withers wrote: However, the only way I could find to solve it was to add a manage_afterAdd method to Squishdot Sites which recatalogued all postings. This is a _lot_ more resource intensive than it needs to be, since I don't actually want to recatalog all postings (quite expensive when there are 3000+ of them ;-), I just want to modify the paths that ZCatalog has stored. Is there any way to do this? There probably should be ;-) Look in the new ZCatalog product (released for testing a few weeks ago), in the manage_normalize_paths method of ZCatalog.py (line 603). This method goes through every item in the Catalog, and checks to see if its path needs to be changed to the new convention of using the physical path to the object. You could use a modified version of this method to do what you want, calling it from manage_afterAdd. You may need to store the old path to the ZCatalog instance in an attribute, so you'll know how to change the paths. The following code should help, although I haven't tested it. It is shamelessly cribbed from Chris P's manage_normalize_paths method. paths = self._catalog.paths uids = self._catalog.uids for path, rid in uids.items(): new_path=_method_to_return_new_path_after_add(path) del uids[path] paths[rid] = new_path uids[ppath] = rid -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] DTML Documents == DTML Methods that are anchored?
The Doctor What writes: What are the differences between DTML Documents and Methods internally? There are too small differences: 1. DTML documents implement the "PropertyManager" interface, i.e. they can have properties other than "id" and "title". 2. DTML documents place themselves on top of the DTML namespace when they are rendered (called), DTML methods do not place themselves on the namespace at all for rendering. The effect is that during name lookup a DTML Document is asked early whether it (or its acquisition ancestors) can satisfy the name request. If it can, you get this object. A DTML Method, on the other hand, would not be asked in a similar situation, as it is not on the namespace stack. This means, name lookup looks through the DTML Method directly onto the method's client, the Method is completely transparent. A DTML Document is only partially transparent, it hides all names that it or its acquisition ancestors define. Only the other names are handled in the same way as would be the case for a DTML method. 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 )