~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/base/rest.py

  • Committer: Nick Chadwick
  • Date: 2009-02-18 12:50:31 UTC
  • mto: (1099.1.180 new-dispatch)
  • mto: This revision was merged to the branch mainline in revision 1100.
  • Revision ID: chadnickbok@gmail.com-20090218125031-0gwxxfljq1iqipgz
Working on putting worksheets into the database.

This will lead to a nice editor for each worksheet.

This commit also introduces my changes linking problem attempts to
worksheets AND exercises, not just exercises.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# Author: Matt Giuca, Will Grant
19
19
 
20
20
import cgi
 
21
import urlparse
21
22
import inspect
22
23
 
23
24
import cjson
87
88
        # POST implies named operation.
88
89
        elif req.method == 'POST':
89
90
            # TODO: Check Content-Type and implement multipart/form-data.
90
 
            opargs = dict(cgi.parse_qsl(req.read()))
 
91
            data = req.read()
 
92
            opargs = cgi.parse_qs(data, keep_blank_values=1)
91
93
            try:
92
94
                opname = opargs['ivle.op']
93
 
                del opargs['ivle.op']
94
95
            except KeyError:
 
96
                req.write(str(data))
95
97
                raise BadRequest('No named operation specified.')
96
98
 
97
99
            try: