Ejemplo n.º 1
0
 def dimRelationships(self, structuralNode, getMembers=False, getDimQname=False):
     dimensionQname = structuralNode.evaluate(self, self.evalDimensionQname)
     sourceQname = structuralNode.evaluate(self, self.evalRrelationshipSourceQname) or XbrlConst.qnXfiRoot
     linkrole = structuralNode.evaluate(self, self.evalLinkrole)
     if not linkrole and getMembers:
         linkrole = "XBRL-all-linkroles"
     dimConcept = self.modelXbrl.qnameConcepts.get(dimensionQname)
     sourceConcept = self.modelXbrl.qnameConcepts.get(sourceQname)
     axis = self.axis
     generations = (structuralNode.evaluate(self, self.evalGenerations) or () )
     if ((dimensionQname and (dimConcept is None or not dimConcept.isDimensionItem)) or
         (sourceQname and sourceQname != XbrlConst.qnXfiRoot and (
                 sourceConcept is None or not sourceConcept.isItem))):
         return ()
     if dimConcept is not None:
         if getDimQname:
             return dimensionQname
         if sourceConcept is None:
             sourceConcept = dimConcept
     if getMembers:
         return concept_relationships(self.modelXbrl.rendrCntx, 
                                      None, 
                                      (sourceQname,
                                       linkrole,
                                       "XBRL-dimensions",  # all dimensions arcroles
                                       axis.replace('-or-self',''),
                                       generations),
                                      True) # return nested lists representing concept tree nesting
     if getDimQname:
         if sourceConcept is not None:
             # look back from member to a dimension
             return self.stepDimRel(sourceConcept, linkrole)
         return None
Ejemplo n.º 2
0
 def relationships(self, structuralNode):
     sourceQname = structuralNode.evaluate(self, self.evalRrelationshipSourceQname) or XbrlConst.qnXfiRoot
     linkrole = structuralNode.evaluate(self, self.evalLinkrole)
     if not linkrole:
         linkrole = "XBRL-all-linkroles"
     linkQname = (structuralNode.evaluate(self, self.evalLinkQname) or () )
     arcrole = (structuralNode.evaluate(self, self.evalArcrole) or () )
     arcQname = (structuralNode.evaluate(self, self.evalArcQname) or () )
     axis = self.axis
     generations = (structuralNode.evaluate(self, self.evalGenerations) or () )
     return concept_relationships(self.modelXbrl.rendrCntx, 
                                  None, 
                                  (sourceQname,
                                   linkrole,
                                   arcrole,
                                   axis.replace('-or-self',''),
                                   generations,
                                   linkQname,
                                   arcQname),
                                  True) # return nested lists representing concept tree nesting