code: def save_model(self, request, obj, form, change):
          ''' Our custom addition to the view
              adds an easy radio button choice for the new state. This is meant to be for tutors.
              We need to peel this choice from the form data and set the state accordingly.
              The radio buttons have no default, so that we can keep the existing state
              if the user makes no explicit choice.
              Everything else can be managed as prepared by the framework.
          '''
          if 'newstate' in request.POST:
              if request.POST['newstate'] == 'finished':
                  obj.state = Submission.GRADED
              elif request.POST['newstate'] == 'unfinished':
                  obj.state = Submission.GRADING_IN_PROGRESS
          obj.save(f save_model(self, request, obj, form, change):
          ''' Our custom addition to the view
              adds an easy radio button choice for the new state. This is meant to be for tutors.
              We need to peel this choice from the form data and set the state accordingly.
              The radio buttons have no default, so that we can keep the existing state
              if the user makes no explicit choice.
              Everything else can be managed as prepared by the framework.
          '''
          if 'newstate' in request.POST:
              if request.POST['newstate'] == 'finished':
                  obj.state = Submission.GRADED
              elif request.POST['newstate'] == 'unfinished':
                  obj.state = Submission.GRADING_IN_PROGRESS
          obj.save()
docs: Our custom addition to the view
              adds an easy radio button choice for the new state. This is meant to be for tutors.
              We need to peel this choice from the form data and set the state accordingly.
              The radio buttons have no default, so that we can keep the existing state
              if the user makes no explicit choice.
              Everything else can be managed as prepared by the framework.