def extEdgarReportUpdate(xbrlOpenDb): agencySchemaDocId = stdSchemaDocId = None for mdlDoc in xbrlOpenDb.modelXbrl.urlDocs.values(): if mdlDoc in xbrlOpenDb.documentIds: for refDoc, ref in mdlDoc.referencesDocument.items(): if refDoc.inDTS and ref.referenceType in ("href", "import", "include") \ and refDoc in xbrlOpenDb.documentIds: if refDoc.type == Type.SCHEMA: nsAuthority = authority(refDoc.targetNamespace, includeScheme=False) nsPath = refDoc.targetNamespace.split('/') if len(nsPath) > 2: if ((nsAuthority in ("fasb.org", "xbrl.us") and nsPath[-2] == "us-gaap") or (nsAuthority == "xbrl.ifrs.org" and nsPath[-1] in ("ifrs", "ifrs-full", "ifrs-smes"))): stdSchemaDocId = xbrlOpenDb.documentIds[refDoc] elif (nsAuthority == "xbrl.sec.gov" and nsPath[-2] == "rr"): agencySchemaDocId = xbrlOpenDb.documentIds[ refDoc] if agencySchemaDocId or stdSchemaDocId: xbrlOpenDb.updateTable( "report_edgar", ("report_pk", "agency_schema_doc_fk", "standard_schema_doc_fk"), ((xbrlOpenDb.reportPk, agencySchemaDocId, stdSchemaDocId), ))
def addRefDocs(doc): for refDoc in doc.referencesDocument.keys(): _file = refDoc.filepath if refDoc.uri not in refDocUris: refDocUris.add(refDoc.uri) if refDoc.filepath and refDoc.filepath.startswith(sourceDir): self.reportedFiles.add(refDoc.filepath[len(sourceDir)+1:]) # add file name within source directory addRefDocs(refDoc) if refDoc.type == ModelDocument.Type.SCHEMA and refDoc.targetNamespace: nsAuthority = authority(refDoc.targetNamespace, includeScheme=False) nsPath = refDoc.targetNamespace.split('/') if len(nsPath) > 2: if nsAuthority in ("fasb.org", "xbrl.us") and nsPath[-2] == "us-gaap": self.hasUsGaapTaxonomy = True
def extEdgarReportUpdate(xbrlOpenDb): agencySchemaDocId = stdSchemaDocId = None for mdlDoc in xbrlOpenDb.modelXbrl.urlDocs.values(): if mdlDoc in xbrlOpenDb.documentIds: for refDoc, ref in mdlDoc.referencesDocument.items(): if refDoc.inDTS and ref.referenceType in ("href", "import", "include") \ and refDoc in xbrlOpenDb.documentIds: if refDoc.type == Type.SCHEMA: nsAuthority = authority(refDoc.targetNamespace, includeScheme=False) nsPath = refDoc.targetNamespace.split('/') if len(nsPath) > 2: if ((nsAuthority in ("fasb.org", "xbrl.us") and nsPath[-2] == "us-gaap") or (nsAuthority == "xbrl.ifrs.org" and nsPath[-1] in ("ifrs", "ifrs-full", "ifrs-smes"))): stdSchemaDocId = xbrlOpenDb.documentIds[refDoc] elif (nsAuthority == "xbrl.sec.gov" and nsPath[-2] == "rr"): agencySchemaDocId = xbrlOpenDb.documentIds[refDoc] if agencySchemaDocId or stdSchemaDocId: xbrlOpenDb.updateTable("report_edgar", ("report_pk", "agency_schema_doc_fk", "standard_schema_doc_fk"), ((xbrlOpenDb.reportPk, agencySchemaDocId, stdSchemaDocId),) )