Beispiel #1
0
def job_industry_cluster(obj):
    if IIndustryCluster.providedBy(obj.__parent__):
        return obj.__parent__.id
    if IJobGroup.providedBy(obj.__parent__):
        jobgroup = obj.__parent__
        if IIndustryCluster.providedBy(jobgroup.__parent__):
            return jobgroup.__parent__.id
    return 'no-industry-cluster'
Beispiel #2
0
def job_industry_cluster(obj):
    if IIndustryCluster.providedBy(obj.__parent__):
        return obj.__parent__.id
    if IJobGroup.providedBy(obj.__parent__):
        jobgroup = obj.__parent__
        if IIndustryCluster.providedBy(jobgroup.__parent__):
            return jobgroup.__parent__.id
    return 'no-industry-cluster'
 def cluster(self):
     group = aq_parent(self.context)
     if not IJobGroup.providedBy(group):
         return None
     cluster = aq_parent(group)
     if not IIndustryCluster.providedBy(cluster):
         return None
     return cluster