def dump_module_extensions(course, unit):
 data = []
 header = [_('Username'), _('Full Name'), _('Extended Due Date')]
 query = StudentFieldOverride.objects.filter(course_id=course.id, location=unit.location, field='due')
 for override in query:
  due = DATE_FIELD.from_json(json.loads(override.value))
  due = due.strftime('%Y-%m-%d %H:%M')
  fullname = override.student.profile.name
  data.append(dict(zip(header, (override.student.username, fullname, due))))
 data.sort(key=(lambda x: x[header[0]]))
 return {'header': header, 'title': _('Users with due date extensions for {0}').format(title_or_url(unit)), 'data': data}

def dump_module_extensions ( course , unit ) : data = [ ] header = [ _ ( 'Username' ) , _ ( 'Full Name' ) , _ ( 'Extended Due Date' ) ] query = StudentFieldOverride . objects . filter ( course_id = course . id , location = unit . location , field = 'due' ) for override in query : due = DATE_FIELD . from_json ( json . loads ( override . value ) ) due = due . strftime ( '%Y-%m-%d %H:%M' ) fullname = override . student . profile . name data . append ( dict ( zip ( header , ( override . student . username , fullname , due ) ) ) ) data . sort ( key = ( lambda x : x [ header [ 0 ] ] ) ) return { 'header' : header , 'title' : _ ( 'Users with due date extensions for {0}' ) . format ( title_or_url ( unit ) ) , 'data' : data }
dumps data about students with due date extensions for a particular module .