Example #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'
Example #2
0
 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
Example #3
0
    def job_grouping(self):
        parent = aq_parent(self.context)
        if not IJobGroup.providedBy(parent):
            return []

        parent_container = aq_parent(parent)
        groups = []
        for o in parent_container.values():
            if IJobGroup.providedBy(o):
                data = {
                    'title': o.pretty_title_or_id(),
                    'css_class': ''
                }
                if o == parent:
                    data['css_class'] = 'selected-group'
                groups.append(data)
        return groups
Example #4
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'