ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> zope-Dev
zope-Dev
Re: [Zope-dev] Change Request in TextIndex implementation
by Andreas Jung other posts by this author
Jul 31 2001 8:53PM messages near this date
Re: [Zope-dev] Change Request in TextIndex implementation | Re: [Zope-dev] BTrees and ConflictErrors.
----- Original Message ----- 
From: "Casey Duncan" <cduncan@[...].com> 
To: <zope-dev@[...].org> 
Sent: Dienstag, 31. Juli 2001 11:28
Subject: [Zope-dev] Change Request in TextIndex implementation


>  I have a product that uses a Catalogs (just plain, not ZCatalogs) for
>  indexing objects. It uses several Catalogs each of which share a
>  Vocabulary. This was easy to do in 2.3, however, some code in 2.4 makes
>  this a pain in the rear. Specifically line 204 of TextIndex.py, which
>  tries to get the vocabulary lexicon from the parent ZCatalog like so:
>  
>  self._lexicon =
>  self.aq_parent.aq_parent[self.vocabulary_id].getLexicon()
>  
>  In a world of implicit aquisition, this strikes me as very bad form. For
>  this to work, the vocabulary must reside in the parent of the parent of
>  the index, which must be a mapping object for it to find it. This is not
>  the case with my implementation, in fact the vocabulary can be basically
>  anywhere above the index.
>  
>  Of course, I could simply pass in the lexicon when the Index is
>  instantiated. This is great and wonderful, except, I would like to
>  support Zope 2.3 in as seemless a way possible. Writing crap like this
>  bothers me (although I have little choice at this point methinks):
>  
>  try:
>      index = TextIndex('spam', lexicon=eggs)
>  except:
>      index = 'TextIndex'
>  
>  Can't we change the above line to be something like this, which does not
>  depend on a specific hierarchy?
>  
>  self._lexicon = self.aq_parent.getattr(self.vocabulary_id).getLexicon()
>  
>  That would make me very happy...

Be happy. I fixed the problem in the CVS.

Andreas



_______________________________________________
Zope-Dev maillist  -  Zope-Dev@[...].org
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 )
Thread:
Casey Duncan
Chris Withers
Andreas Jung

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved