def dump_student_extensions(course, student):
 data = []
 header = [_('Unit'), _('Extended Due Date')]
 units = get_units_with_due_date(course)
 units = {u.location: u for u in units}
 query = StudentFieldOverride.objects.filter(course_id=course.id, student=student, field='due')
 for override in query:
  location = override.location.replace(course_key=course.id)
  if (location not in units):
   continue
  due = DATE_FIELD.from_json(json.loads(override.value))
  due = due.strftime('%Y-%m-%d %H:%M')
  title = title_or_url(units[location])
  data.append(dict(zip(header, (title, due))))
 return {'header': header, 'title': _('Due date extensions for {0} {1} ({2})').format(student.first_name, student.last_name, student.username), 'data': data}

def dump_student_extensions ( course , student ) : data = [ ] header = [ _ ( 'Unit' ) , _ ( 'Extended Due Date' ) ] units = get_units_with_due_date ( course ) units = { u . location : u for u in units } query = StudentFieldOverride . objects . filter ( course_id = course . id , student = student , field = 'due' ) for override in query : location = override . location . replace ( course_key = course . id ) if ( location not in units ) : continue due = DATE_FIELD . from_json ( json . loads ( override . value ) ) due = due . strftime ( '%Y-%m-%d %H:%M' ) title = title_or_url ( units [ location ] ) data . append ( dict ( zip ( header , ( title , due ) ) ) ) return { 'header' : header , 'title' : _ ( 'Due date extensions for {0} {1} ({2})' ) . format ( student . first_name , student . last_name , student . username ) , 'data' : data }
dumps data about the due date extensions granted for a particular student in a particular course .