Fix metadata introspection in course admin page

This commit is contained in:
Calen Pennington
2013-03-08 21:17:12 -05:00
parent 6395745c2b
commit 1f593428d4
2 changed files with 6 additions and 2 deletions

View File

@@ -88,7 +88,11 @@ def instructor_dashboard(request, course_id):
data = [['# Enrolled', CourseEnrollment.objects.filter(course_id=course_id).count()]]
data += compute_course_stats(course).items()
if request.user.is_staff:
data.append(['metadata', escape(str(course._model_data))])
for field in course.fields:
data.append([field.name, json.dumps(field.read_json(course))])
for namespace in course.namespaces:
for field in getattr(course, namespace).fields:
data.append(["{}.{}".format(namespace, field.name), json.dumps(field.read_json(course))])
datatable['data'] = data
def return_csv(fn, datatable, fp=None):

View File

@@ -6,4 +6,4 @@
# XBlock:
# Might change frequently, so put it in local-requirements.txt,
# but conceptually is an external package, so it is in a separate repo.
-e git+ssh://git@github.com/MITx/xmodule-debugger@e3c4bc#egg=XBlock
-e git+ssh://git@github.com/MITx/xmodule-debugger@857dcfe8#egg=XBlock