(domain, doc_type, case_type_or_xmlns=None, load_source="unknown")
return DocStoreLoadTracker(store, track_load)
Only applies to documents that have a document type:
    * forms
    * cases
    * locations
    * leddgers (V2 only)
    * all couch models
Only applies to documents that have a document type:
    * forms
    * cases
    * locations
    * leddgers (V2 only)
    * all couch models
Only applies to documents that have a document type : * forms * cases * locations * leddgers ( V2 only ) * all couch models
def get_document_store_for_doc_type(domain, doc_type, case_type_or_xmlns=None, load_source="unknown"):
    """Only applies to documents that have a document type:
    * forms
    * cases
    * locations
    * leddgers (V2 only)
    * all couch models
    """
    from corehq.apps.change_feed import document_types
    if doc_type in XFormInstanceSQL.ALL_DOC_TYPES:
        store = FormDocumentStore(domain, xmlns=case_type_or_xmlns)
        load_counter = form_load_counter
    elif doc_type in document_types.CASE_DOC_TYPES:
        store = CaseDocumentStore(domain, case_type=case_type_or_xmlns)
        load_counter = case_load_counter
    elif doc_type == LOCATION_DOC_TYPE:
        return LocationDocumentStore(domain)
    elif doc_type == topics.LEDGER:
        return LedgerV2DocumentStore(domain)
    else:
        # all other types still live in couchdb
        return CouchDocumentStore(
            couch_db=get_db_by_doc_type(doc_type),
            domain=domain,
            doc_type=doc_type
        )
    track_load = load_counter(load_source, domain)
    return DocStoreLoadTracker(store, track_load)
def get_document_store_for_doc_type ( domain , doc_type , case_type_or_xmlns = None , load_source = "unknown" ) : from corehq . apps . change_feed import document_types if doc_type in XFormInstanceSQL . ALL_DOC_TYPES : store = FormDocumentStore ( domain , xmlns = case_type_or_xmlns ) load_counter = form_load_counter elif doc_type in document_types . CASE_DOC_TYPES : store = CaseDocumentStore ( domain , case_type = case_type_or_xmlns ) load_counter = case_load_counter elif doc_type == LOCATION_DOC_TYPE : return LocationDocumentStore ( domain ) elif doc_type == topics . LEDGER : return LedgerV2DocumentStore ( domain ) else : # all other types still live in couchdb return CouchDocumentStore ( couch_db = get_db_by_doc_type ( doc_type ) , domain = domain , doc_type = doc_type ) track_load = load_counter ( load_source , domain ) return DocStoreLoadTracker ( store , track_load )