Casey Duncan wrote:
> [EMAIL PROTECTED] wrote:
> >
> > I tried both
> >
> >    my_catalog = Catalog(GlobbingLexicon())
> >
> > and
> >
> >    my_catalog = Catalog(Vocabulary(globbing=1))
> >
> > and neither resulted in any calls to any GlobbingLexicon methods!
> >
> >      Richard
> >
> 
> Catalog doesn't take the Vocabulary object itself as an argument. It
> takes the (string) id of an acquirable Vocabulary. If you don't specify
> a string, it creates a standard non-globbing lexicon (Although a
> ZCatalog creates a globbing lexicon, go figure).

Ack, you're quite right. I completely missed the "if type(vocabulary) is
type(''):" clause. Thanks for pointing that out.


> I'm completely unsure why it was implemented this way. I can kinda
> understand for ZCatalog, but not really for Catalog. Anyone care to
> explain??

Does seem a little odd to me.


> or you could do this without using acquistion, but you wind up creating
> the vocabulary twice:
> 
> my_cat = Catalog()
> my_cat.lexicon = Vocabulary(globbing=1)

I used:

   my_cat = Catalog()
   my_cat.lexicon = GlobbingLexicon()

since the Vocabulary class appears to be a wrapper for the Lexicon allowing
management, and I don't need that. The lexicon now works fine.


Thanks for your help - now to work on the 'or' searching :)


     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 )

Reply via email to