def __build_candidates(self): self.candidates = {} for clazz in self.candidate_classes: self.__build_candidate(clazz) loader = ActivityLoader() for clazz in loader.get_activities_instances(): self.__build_candidate(clazz)
def get_keys(): names = {} associations = {'activities': [], 'meetings': [], 'user': []} loader = ActivityLoader() for e in loader.get_activities_instances(): names[e.key] = e.name associations['user'].append(e.key) for e in Interpreter.candidate_classes: names[e.key] = e.name if e.is_activity(): associations['activities'].append(e.key) else: associations['meetings'].append(e.key) return jsonify({'names': names, 'associations': associations})