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

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/service.py

  • Committer: William Grant
  • Date: 2010-07-03 11:15:42 UTC
  • mfrom: (1796.1.3 get-named-operations)
  • Revision ID: grantw@unimelb.edu.au-20100703111542-pc9odlk2bv4tj3rr
Named operations must now be declared as read_operation or write_operation. Read operations may be executed with a GET.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from ivle.database import Exercise, ExerciseAttempt, ExerciseSave, Worksheet, \
29
29
                          Offering, Subject, Semester, User, WorksheetExercise
30
30
import ivle.worksheet.utils
31
 
from ivle.webapp.base.rest import (JSONRESTView, named_operation,
 
31
from ivle.webapp.base.rest import (JSONRESTView, write_operation,
32
32
                                   require_permission)
33
33
from ivle.webapp.errors import NotFound
34
34
 
91
91
class WorksheetExerciseRESTView(JSONRESTView):
92
92
    '''REST view of a worksheet exercise.'''
93
93
 
94
 
    @named_operation('view')
 
94
    @write_operation('view')
95
95
    def save(self, req, text):
96
96
        # Find the appropriate WorksheetExercise to save to. If its not found,
97
97
        # the user is submitting against a non-existant worksheet/exercise
118
118
class WorksheetsRESTView(JSONRESTView):
119
119
    """View used to update and create Worksheets."""
120
120
 
121
 
    @named_operation('edit_worksheets')
 
121
    @write_operation('edit_worksheets')
122
122
    def move_up(self, req, worksheetid):
123
123
        """Takes a list of worksheet-seq_no pairs and updates their 
124
124
        corresponding Worksheet objects to match."""
139
139
        
140
140
        return {'result': 'ok'}
141
141
 
142
 
    @named_operation('edit_worksheets')
 
142
    @write_operation('edit_worksheets')
143
143
    def move_down(self, req, worksheetid):
144
144
        """Takes a list of worksheet-seq_no pairs and updates their 
145
145
        corresponding Worksheet objects to match."""