def linkroleSetup(self):      
        # determine facs in this linkrole
        relationshipSet = self.modelXbrl.relationshipSet(self.arcrole, self.linkrole, self.linkqname, self.arcqname)
        conceptsInLinkrole = set()
        for rel in relationshipSet:
            conceptsInLinkrole.add(rel.fromModelObject)
            conceptsInLinkrole.add(rel.toModelObject)
            
        # set up facts
        self.conceptFacts = defaultdict(list)
        self.periodContexts = defaultdict(set)
        contextStartDatetimes = {}
        for fact in self.modelXbrl.facts:
            if fact.concept in conceptsInLinkrole:
                self.conceptFacts[fact.qname].append(fact)
                context = fact.context
                if context.isForeverPeriod:
                    contextkey = datetime.datetime(datetime.MINYEAR,1,1)
                else:
                    contextkey = context.endDatetime
                objectId = context.objectId()
                self.periodContexts[contextkey].add(objectId)
                if context.isStartEndPeriod:
                    contextStartDatetimes[objectId] = context.startDatetime

        # sort contexts by period
        self.periodKeys = list(self.periodContexts.keys())
        self.periodKeys.sort()
        # set up treeView widget and tabbed pane
        columnIds = []
        columnIdHeadings = []
        self.contextColId = {}
        self.startdatetimeColId = {}
        self.numCols = 1
        for periodKey in self.periodKeys:
            colId = "#{0}".format(self.numCols)
            columnIds.append(colId)
            columnIdHeadings.append((colId,periodKey))
            for contextId in self.periodContexts[periodKey]:
                self.contextColId[contextId] = colId
                if contextId in contextStartDatetimes:
                    self.startdatetimeColId[contextStartDatetimes[contextId]] = colId
            self.numCols += 1
        self.treeView["columns"] = columnIds
        for colId, colHeading in columnIdHeadings:
            self.treeView.column(colId, width=60, anchor="w")
            if colHeading.year == datetime.MINYEAR:
                date = "forever"
            else:
                date = (colHeading - datetime.timedelta(days=1)).strftime("%Y-%m-%d")
            self.treeView.heading(colId, text=date)
        return True
dataset/ETHPy150Open Arelle/Arelle/arelle/ViewWinFactGrid.py/ViewFactsGrid.linkroleSetup/original