def xpath(self): parts = self.column.field.split('/') if self.column.model == 'case': parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts case = CaseXPath('') for index in indexes: case = case.index_id(index).case() return case.property(property)
def xpath(self): parts = self.column.field.split('/') if self.column.model == 'case': parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts use_relative = property != '#owner_name' if use_relative: case = CaseXPath('')
def xpath(self): parts = self.column.field.split('/') if self.column.model == 'case': parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts use_relative = property != '#owner_name' if use_relative: case = CaseXPath('') else: case = CaseXPath(u'current()') for index in indexes: case = case.index_id(index).case() if property == '#owner_name': return self.owner_name(case.property('@owner_id')) else: return case.property(property)
def _get_detail_tab_nodeset(self, module, detail, tab): if not tab.has_nodeset: return None if tab.nodeset: return tab.nodeset if tab.nodeset_case_type: nodeset = CaseTypeXpath(tab.nodeset_case_type) nodeset = nodeset.case( instance_name=detail.get_instance_name(module)) nodeset = nodeset.select( CaseXPath().parent_id(), CaseXPath("current()").property("@case_id")) nodeset = nodeset.select("@status", "open") if tab.nodeset_filter: nodeset = nodeset.select_raw( interpolate_xpath(tab.nodeset_filter)) return nodeset return None
def xpath(self): if self.column.model == "product": return self.column.field parts = self.column.field.split("/") if self.column.model == "case": parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts use_relative = property != "#owner_name" if use_relative: case = CaseXPath("") else: case = CaseXPath(u"current()") if indexes and indexes[0] == "user": case = CaseXPath(UserCaseXPath().case()) else: for index in indexes: case = case.index_id(index).case() if property == "#owner_name": return self.owner_name(case.property("@owner_id")) else: return case.property(property)
def xpath(self): if self.column.model == 'product': return self.column.field parts = self.column.field.split('/') if self.column.model == 'case': parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts use_absolute = indexes or property == '#owner_name' if use_absolute: case = CaseXPath('current()') else: case = CaseXPath('') if indexes and indexes[0] == 'user': case = CaseXPath(UserCaseXPath().case()) else: for index in indexes: case = case.index_id(index).case() if property == '#owner_name': return self.owner_name(case.property('@owner_id')) else: return case.property(property)
def xpath(self): if self.column.model == 'product': return self.column.field parts = self.column.field.split('/') if self.column.model == 'case': parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts use_absolute = indexes or property == '#owner_name' if use_absolute: case = CaseXPath('current()')
@property def xpath(self): if self.column.model == 'product': return self.column.field parts = self.column.field.split('/') if self.column.model == 'case': parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts use_absolute = indexes or property == '#owner_name' if use_absolute: case = CaseXPath('current()') else: case = CaseXPath('') if indexes and indexes[0] == 'user': case = CaseXPath(UsercaseXPath().case()) else: for index in indexes: case = case.index_id(index).case( instance_name=self.detail.instance_name) if property == '#owner_name': return self.owner_name(case.property('@owner_id')) else: return case.property(property) @staticmethod def owner_name(owner_id):
@property def xpath(self): if self.column.model == 'product': return self.column.field parts = self.column.field.split('/') if self.column.model == 'case': parts[-1] = CASE_PROPERTY_MAP.get(parts[-1], parts[-1]) property = parts.pop() indexes = parts use_relative = property != '#owner_name' if use_relative: case = CaseXPath('') else: case = CaseXPath(u'current()') if indexes and indexes[0] == 'user': case = CaseXPath(UserCaseXPath().case()) else: for index in indexes: case = case.index_id(index).case() if property == '#owner_name': return self.owner_name(case.property('@owner_id')) else: return case.property(property) @staticmethod def owner_name(owner_id): groups = XPath(u"instance('groups')/groups/group")