[BlueBream] using catalog

Baiju M baiju.m.mail at gmail.com
Fri Sep 3 06:51:36 EDT 2010


On Fri, Sep 3, 2010 at 2:22 PM, Ilshad Khabibullin <astoon.net at gmail.com> wrote:
> Regard to BB template:
> +1 for zope.keyreference and zope.intid. In any case we use ZODB.
> -1 for zope.catalog (though personally I use it but zope.catalog is merely
> container for indexes. So it can be other decisions like z3c.indexer or just
> using indexes directly).

Ok, will add zope.keyreference and zope.intid

> Here are example, catalog works well: http://paste.lisp.org/display/114183

Thanks for the example, now my search is working fine :)

I implemented like this:

class Ticket(BTreeContainer, Contained):

    implements(ITicket, ITicketContained, ISearchableText)

    number = u""
    summary = u""

    def getSearchableText(self):
        """ """
        return self.number + " " + self.summary

And site manager set up ad you given in the example:

def setup_site_manager(context):
    context.setSiteManager(LocalSiteManager(context))
    sm = context.getSiteManager()

    uid = IntIds()
    sm[u'intids'] = uid
    sm.registerUtility(uid, IIntIds)
    catalog = Catalog()
    sm[u'catalog'] = catalog
    sm.registerUtility(catalog, ICatalog)
    catalog[u'fulltext'] = TextIndex(
        interface=ISearchableText,
        field_name='getSearchableText',
        field_callable=True)

Now I need to make this into a HOWTO form.
Also I will update project template.

Regards,
Baiju M


More information about the bluebream mailing list