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

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: Nick Chadwick
  • Date: 2009-05-06 01:13:02 UTC
  • mto: (1165.3.38 submissions-admin)
  • mto: This revision was merged to the branch mainline in revision 1247.
  • Revision ID: chadnickbok@gmail.com-20090506011302-jo7qkbfaws3ktrfk
Added a get_assigned method to project sets, to find out which objects
are assigned to its projects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
379
379
 
380
380
        return enrolment
381
381
 
 
382
    def get_students(self):
 
383
        return self.enrolments.find(role='student')
 
384
 
382
385
class Enrolment(Storm):
383
386
    """An enrolment of a user in an offering.
384
387
 
438
441
    def get_permissions(self, user):
439
442
        return self.offering.get_permissions(user)
440
443
 
 
444
    # Get the individuals (groups or users) Assigned to this project
 
445
    def get_assigned(self):
 
446
        #If its a Solo project, return everyone in offering
 
447
        if self.max_students_per_group is None:
 
448
            return self.offering.get_students()
 
449
        else:
 
450
            return self.project_groups
 
451
 
441
452
class Project(Storm):
442
453
    """A student project for which submissions can be made."""
443
454