当前位置: 首页>>代码示例>>Python>>正文


Python XbrlConst.isLabelRole方法代码示例

本文整理汇总了Python中arelle.XbrlConst.isLabelRole方法的典型用法代码示例。如果您正苦于以下问题:Python XbrlConst.isLabelRole方法的具体用法?Python XbrlConst.isLabelRole怎么用?Python XbrlConst.isLabelRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在arelle.XbrlConst的用法示例。


在下文中一共展示了XbrlConst.isLabelRole方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: insertResources

# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import isLabelRole [as 别名]
 def insertResources(self):
     self.showStatus("insert resources")
     table = self.getTable('resource', 'resource_id', 
                           ('role_uri_id', 'qname_id', 'document_id', 'document_line_number', 'document_column_number'), 
                           ('role_uri_id', 'qname_id', 'document_id', 'document_line_number', 'document_column_number'), 
                           tuple((self.uriId[resource.role],
                                  self.qnameId[resource.qname],
                                  self.documentIds[resource.modelDocument.uri],
                                  resource.sourceline,
                                  0)
                                 for arcrole in (XbrlConst.conceptLabel, XbrlConst.conceptReference)
                                 for rel in self.modelXbrl.relationshipSet(arcrole).modelRelationships
                                 for resource in (rel.fromModelObject, rel.toModelObject)
                                 if isinstance(resource, ModelResource)))
     self.resourceId = dict(((roleId, qnId, docId, line, offset), id)
                            for id, roleId, qnId, docId, line, offset in table)
     
     self.showStatus("insert labels")
     table = self.getTable('label_resource', 'resource_id', 
                           ('resource_id', 'label', 'xml_lang'), 
                           ('resource_id',), 
                           tuple((self.resourceId[self.uriId[resource.role],
                                                  self.qnameId[resource.qname],
                                                  self.documentIds[resource.modelDocument.uri],
                                                  resource.sourceline,
                                                  0],
                                  resource.elementText,
                                  resource.xmlLang)
                                 for arcrole in (XbrlConst.conceptLabel, XbrlConst.conceptReference)
                                 for rel in self.modelXbrl.relationshipSet(arcrole).modelRelationships
                                 for resource in (rel.fromModelObject, rel.toModelObject)
                                 if isinstance(resource, ModelResource) and XbrlConst.isLabelRole(resource.role)))
开发者ID:dknochen,项目名称:Arelle,代码行数:34,代码来源:XbrlPublicPostgresDB.py

示例2: insertResources

# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import isLabelRole [as 别名]
 def insertResources(self):
     self.showStatus("insert resources")
     # deduplicate resources (may be on multiple arcs)
     # note that lxml has no column numbers, use objectIndex as pseudo-column number
     uniqueResources = dict(((self.documentIds[resource.modelDocument.uri],
                              resource.sourceline,
                              resource.objectIndex), resource)
                            for arcrole in (XbrlConst.conceptLabel, XbrlConst.conceptReference)
                            for rel in self.modelXbrl.relationshipSet(arcrole).modelRelationships
                            if rel.fromModelObject is not None and rel.toModelObject is not None
                            for resource in (rel.fromModelObject, rel.toModelObject)
                            if isinstance(resource, ModelResource))
     table = self.getTable('resource', 'resource_id', 
                           ('role_uri_id', 'qname_id', 'document_id', 'document_line_number', 'document_column_number'), 
                           ('document_id', 'document_line_number', 'document_column_number'), 
                           tuple((self.uriId[resource.role],
                                  self.qnameId[resource.qname],
                                  self.documentIds[resource.modelDocument.uri],
                                  resource.sourceline,
                                  resource.objectIndex)
                                 for resource in uniqueResources.values()),
                           checkIfExisting=True)
     self.resourceId = dict(((docId, line, offset), id)
                            for id, docId, line, offset in table)
     
     self.showStatus("insert labels")
     table = self.getTable('label_resource', 'resource_id', 
                           ('resource_id', 'label', 'xml_lang'), 
                           ('resource_id',), 
                           tuple((self.resourceId[self.documentIds[resource.modelDocument.uri],
                                                  resource.sourceline,
                                                  resource.objectIndex],
                                  resource.textValue,
                                  resource.xmlLang)
                                 for arcrole in (XbrlConst.conceptLabel, XbrlConst.conceptReference)
                                 for rel in self.modelXbrl.relationshipSet(arcrole).modelRelationships
                                 if rel.fromModelObject is not None and rel.toModelObject is not None
                                 for resource in (rel.fromModelObject, rel.toModelObject)
                                 if isinstance(resource, ModelResource) and XbrlConst.isLabelRole(resource.role)),
                           checkIfExisting=True)
开发者ID:GuoHuiChen,项目名称:Arelle,代码行数:42,代码来源:XbrlPublicPostgresDB.py


注:本文中的arelle.XbrlConst.isLabelRole方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。