[BlueBream] using catalog
Baiju M
baiju.m.mail at gmail.com
Thu Sep 2 10:18:53 EDT 2010
Hi,
I was trying to use a catalog here:
http://github.com/bluebream/ticketcollector/tree/catalog
I have a method like this which is called when adding the application:
def setup_site_manager(context):
context.setSiteManager(LocalSiteManager(context))
sm = context.getSiteManager()
cat = Catalog()
context['catalog'] = cat
sm.registerUtility(removeSecurityProxy(cat), ICatalog, 'tccatalog')
cat['summary'] = TextIndex('summary', ITicket)
cat['number'] = TextIndex('number', ITicket)
if sm.queryUtility(IIntIds) is None:
uid = IntIds()
context['uid'] = uid
sm.registerUtility(removeSecurityProxy(uid), IIntIds, '')
I am trying to use catalog like this:
@form.action("Search")
def search(self, action, data):
catalog = getUtility(ICatalog, context=self.context, name='tccatalog')
query_text = self.request.form['q']
result = catalog.searchResults(number=query_text)
return str(len(result))
I always getting 0 result. What I need to check ?
Regards,
Baiju M
More information about the bluebream
mailing list