Commit 1e8acbef by Calen Pennington

Add a temporary url for testing xml export triggering

parent f375258b
......@@ -4,6 +4,7 @@ from django_future.csrf import ensure_csrf_cookie
from django.http import HttpResponse
import json
from fs.osfs import OSFS
@ensure_csrf_cookie
def index(request):
......@@ -32,3 +33,16 @@ def save_item(request):
data = json.loads(request.POST['data'])
keystore().update_item(item_id, data)
return HttpResponse(json.dumps({}))
def temp_force_export(request):
org = 'mit.edu'
course = '6002xs12'
name = '6.002_Spring_2012'
course = keystore().get_item(['i4x', org, course, 'course', name])
fs = OSFS('../data-export-test')
xml = course.export_to_xml(fs)
with fs.open('course.xml', 'w') as course_xml:
course_xml.write(xml)
return HttpResponse('Done')
......@@ -8,4 +8,5 @@ urlpatterns = patterns('',
url(r'^$', 'contentstore.views.index', name='index'),
url(r'^edit_item$', 'contentstore.views.edit_item', name='edit_item'),
url(r'^save_item$', 'contentstore.views.save_item', name='save_item'),
url(r'^temp_force_export$', 'contentstore.views.temp_force_export')
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment