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

« back to all changes in this revision

Viewing changes to ivle/database.py

Turn the new database methods into properties where appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
386
386
                Enrolment.role == role
387
387
                )
388
388
 
389
 
    def get_students(self):
 
389
    @property
 
390
    def students(self):
390
391
        return self.get_members_by_role(u'student')
391
392
 
392
393
class Enrolment(Storm):
448
449
    def get_permissions(self, user):
449
450
        return self.offering.get_permissions(user)
450
451
 
451
 
    # Get the individuals (groups or users) Assigned to this project
452
 
    def get_assigned(self):
453
 
        #If its a Solo project, return everyone in offering
 
452
    @property
 
453
    def assigned(self):
 
454
        """Get the entities (groups or users) assigned to submit this project.
 
455
 
 
456
        This will be a Storm ResultSet.
 
457
        """
 
458
        #If its a solo project, return everyone in offering
454
459
        if self.max_students_per_group is None:
455
 
            return self.offering.get_students()
 
460
            return self.offering.students
456
461
        else:
457
462
            return self.project_groups
458
463