示例#1
0
 def subregional_churchbodies(self):
     intids = getUtility(IIntIds)
     result = []
     for i in self.context.values():
         if IATFolder.providedBy(i):
             data = {
                 'title': i.Title(),
                 'churchbodies': [
                     o for o in i.values() if IChurchBody.providedBy(o)
                 ]
             }
             if data['churchbodies']:
                 result.append(data)
     return result
示例#2
0
 def subregional_churchbodies(self):
     intids = getUtility(IIntIds)
     result = []
     for i in self.context.values():
         if IATFolder.providedBy(i):
             data = {
                 'title':
                 i.Title(),
                 'churchbodies':
                 [o for o in i.values() if IChurchBody.providedBy(o)]
             }
             if data['churchbodies']:
                 result.append(data)
     return result
示例#3
0
    def __call__(self, context):
        churchbodies = context.portal_catalog(
            portal_type='wcc.churches.churchbody',
            regions=context.getId()
        )
        intids = getUtility(IIntIds)
        terms = []
        keys = []
        for brain in churchbodies:
            intid = intids.getId(brain.getObject())
            terms.append(SimpleTerm(value=intid, title=brain.Title))
            keys.append(intid)

        for obj in context.values():
            if IChurchBody.providedBy(obj):
                intid = intids.getId(obj)
                if intid not in keys:
                    terms.append(SimpleTerm(value=intid,
                                title=obj.Title()))
        return SimpleVocabulary(terms)
示例#4
0
 def regional_churchbodies(self):
     return [i for i in self.context.values() if IChurchBody.providedBy(i)]
示例#5
0
 def regional_churchbodies(self):
     return [i for i in self.context.values() if IChurchBody.providedBy(i)]