'Delete all course schedule within the Date range and specified filters'

def delete_course_schedule(self, rescheduled, reschedule_errors):

    schedules = frappe.get_list(u'Course    Schedule', fields=[u'name', u'schedule_date'], filters=[[u'student_group', u'=', self.student_group], [u'course', u'=', self.course], [u'schedule_date', u'>=', self.course_start_date], [u'schedule_date', u'<=', self.course_end_date]])
    for d in schedules:
        try:
            if (self.day == calendar.day_name[getdate(d.schedule_date).weekday()]):
                frappe.delete_doc(u'Course    Schedule', d.name)
                rescheduled.append(d.name)
        except:
            reschedule_errors.append(d.name)
    return (rescheduled, reschedule_errors)
