本文整理汇总了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)))
示例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)