From 3b7b3fc5fdd44fbfa5615771fbfaf106650d48b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 10 May 2012 13:35:43 +0200 Subject: [PATCH] index commissions associated to dossiers (#1114) --- tabellio/documents/indexer.py | 10 ++++++++++ tabellio/documents/profiles/default/catalog.xml | 3 +++ 2 files changed, 13 insertions(+) diff --git a/tabellio/documents/indexer.py b/tabellio/documents/indexer.py index 0f45688..bb89aa7 100644 --- a/tabellio/documents/indexer.py +++ b/tabellio/documents/indexer.py @@ -85,6 +85,16 @@ questionInterveningPersonsIndexer = indexer(IQuestion)(interveningPersonsIndexer grok.global_adapter(dossierInterveningPersonsIndexer, name="interveningPersonsDoc") grok.global_adapter(questionInterveningPersonsIndexer, name="interveningPersonsDoc") +def commissionsIndexer(obj): + if not obj.commissions: + return None + return [item.to_object.id for item in obj.commissions] + +dossierPolgroupsIndexer = indexer(IDossier)(commissionsIndexer) + +grok.global_adapter(dossierCommissionssIndexer, name="commissionsDoc") + + class IDocumentIndexer(Interface): """Dexterity behavior interface for enabling the dynamic SearchableText diff --git a/tabellio/documents/profiles/default/catalog.xml b/tabellio/documents/profiles/default/catalog.xml index 96c2c4b..0d5aa60 100644 --- a/tabellio/documents/profiles/default/catalog.xml +++ b/tabellio/documents/profiles/default/catalog.xml @@ -18,6 +18,9 @@ + + +