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

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: William Grant
  • Date: 2009-12-09 00:02:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1384.
  • Revision ID: grantw@unimelb.edu.au-20091209000203-2b1bfi4lesns2zze
Add ProjectSet.is_group, a property determining whether it is a group or solo set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
457
457
        return self.offering.get_permissions(user)
458
458
 
459
459
    @property
 
460
    def is_group(self):
 
461
        return self.max_students_per_group is not None
 
462
 
 
463
    @property
460
464
    def assigned(self):
461
465
        """Get the entities (groups or users) assigned to submit this project.
462
466
 
463
467
        This will be a Storm ResultSet.
464
468
        """
465
469
        #If its a solo project, return everyone in offering
466
 
        if self.max_students_per_group is None:
 
470
        if self.is_group:
 
471
            return self.project_groups
 
472
        else:
467
473
            return self.offering.students
468
 
        else:
469
 
            return self.project_groups
470
474
 
471
475
class Project(Storm):
472
476
    """A student project for which submissions can be made."""