(start_datetime, end_datetime)
return paginate_query_across_partitioned_databases(
            XFormInstanceSQL,
            Q(last_modified__gt=start_datetime, last_modified__lte=end_datetime),
            annotate=annotate,
            load_source='forms_by_last_modified'
        )
Returns all forms that have been modified within a time range. The start date is
        exclusive while the end date is inclusive (start_datetime, end_datetime].

        NOTE: This does not include archived forms

        :param start_datetime: The start date of which modified forms must be greater than
        :param end_datetime: The end date of which modified forms must be less than or equal to

        :returns: An iterator of XFormInstanceSQL objects
Returns all forms that have been modified within a time range. The start date is
        exclusive while the end date is inclusive (start_datetime, end_datetime].
Returns all forms that have been modified within a time range . The start date is exclusive while the end date is inclusive ( start_datetime end_datetime ] .
def iter_forms_by_last_modified(start_datetime, end_datetime):
        '''
        Returns all forms that have been modified within a time range. The start date is
        exclusive while the end date is inclusive (start_datetime, end_datetime].

        NOTE: This does not include archived forms

        :param start_datetime: The start date of which modified forms must be greater than
        :param end_datetime: The end date of which modified forms must be less than or equal to

        :returns: An iterator of XFormInstanceSQL objects
        '''
        from corehq.sql_db.util import paginate_query_across_partitioned_databases

        annotate = {
            'last_modified': Greatest('received_on', 'edited_on', 'deleted_on'),
        }

        return paginate_query_across_partitioned_databases(
            XFormInstanceSQL,
            Q(last_modified__gt=start_datetime, last_modified__lte=end_datetime),
            annotate=annotate,
            load_source='forms_by_last_modified'
        )
def iter_forms_by_last_modified ( start_datetime , end_datetime ) : from corehq . sql_db . util import paginate_query_across_partitioned_databases annotate = { 'last_modified' : Greatest ( 'received_on' , 'edited_on' , 'deleted_on' ) , } return paginate_query_across_partitioned_databases ( XFormInstanceSQL , Q ( last_modified__gt = start_datetime , last_modified__lte = end_datetime ) , annotate = annotate , load_source = 'forms_by_last_modified' )