(domain, days, case_type=None)
return query.count()
Returns the number of open cases that have been modified in the last <days> days
Returns the number of open cases that have been modified in the last <days> days
Returns the number of open cases that have been modified in the last <days > days
def cases_in_last(domain, days, case_type=None):
    """
    Returns the number of open cases that have been modified in the last <days> days
    """
    now = datetime.utcnow()
    then = json_format_datetime(now - timedelta(days=int(days)))
    now = json_format_datetime(now)

    query = CaseES().domain(domain).modified_range(gte=then, lte=now).is_closed(False)
    if case_type:
        query = query.case_type(case_type)
    return query.count()
def cases_in_last ( domain , days , case_type = None ) : now = datetime . utcnow ( ) then = json_format_datetime ( now - timedelta ( days = int ( days ) ) ) now = json_format_datetime ( now ) query = CaseES ( ) . domain ( domain ) . modified_range ( gte = then , lte = now ) . is_closed ( False ) if case_type : query = query . case_type ( case_type ) return query . count ( )