Ejemplo n.º 1
0
def _get_exports(domain, include_docs=True, reduce=False, **kwargs):
    from corehq.apps.reports.models import HQExportSchema
    # add saved exports. because of the way in which the key is stored
    # (serialized json) this is a little bit hacky, but works.
    startkey = json.dumps([domain, ""])[:-3]
    endkey = "%s{" % startkey
    return HQExportSchema.get_db().view("couchexport/saved_export_schemas",
                                        startkey=startkey,
                                        endkey=endkey,
                                        include_docs=include_docs,
                                        reduce=reduce,
                                        **kwargs)
Ejemplo n.º 2
0
def get_exports(domain, include_docs=True, **kwargs):
    # add saved exports. because of the way in which the key is stored
    # (serialized json) this is a little bit hacky, but works.
    startkey = json.dumps([domain, ""])[:-3]
    endkey = "%s{" % startkey
    return HQExportSchema.view(
        "couchexport/saved_export_schemas",
        startkey=startkey,
        endkey=endkey,
        include_docs=include_docs,
        **kwargs
    )
Ejemplo n.º 3
0
def _get_exports(domain, include_docs=True, **kwargs):
    from corehq.apps.reports.models import HQExportSchema
    # add saved exports. because of the way in which the key is stored
    # (serialized json) this is a little bit hacky, but works.
    startkey = json.dumps([domain, ""])[:-3]
    endkey = "%s{" % startkey
    return HQExportSchema.get_db().view(
        "couchexport/saved_export_schemas",
        startkey=startkey,
        endkey=endkey,
        include_docs=include_docs,
        **kwargs
    )