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

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: William Grant
  • Date: 2009-02-25 00:08:47 UTC
  • Revision ID: grantw@unimelb.edu.au-20090225000847-gx39z28kucstntoi
Worksheet.worksheet_exercises now only contains active ones.

Use Worksheet.all_worksheet_exercises to get inactive too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
439
439
    attempts = ReferenceSet(id, "ExerciseAttempt.worksheetid")
440
440
    offering = Reference(offering_id, 'Offering.id')
441
441
 
442
 
    # Use worksheet_exercises to get access to the WorksheetExercise objects
443
 
    # binding worksheets to exercises. This is required to access the
 
442
    all_worksheet_exercises = ReferenceSet(id,
 
443
        'WorksheetExercise.worksheet_id')
 
444
 
 
445
    # Use worksheet_exercises to get access to the *active* WorksheetExercise
 
446
    # objects binding worksheets to exercises. This is required to access the
444
447
    # "optional" field.
445
 
    worksheet_exercises = ReferenceSet(id,
446
 
        'WorksheetExercise.worksheet_id')
447
 
        
 
448
    @property
 
449
    def worksheet_exercises(self):
 
450
        return self.all_worksheet_exercises.find(active=True)
448
451
 
449
452
    __init__ = _kwarg_init
450
453