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

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: me at id
  • Date: 2009-01-15 06:08:43 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:branches%2Fstorm:1162
ivle.database.User: Add 'subjects', an attribute containing currently
    enrolled subjects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
            )
133
133
 
134
134
    @property
 
135
    def subjects(self):
 
136
        return Store.of(self).find(Subject,
 
137
            Enrolment.user_id == self.id,
 
138
            Enrolment.active == True,
 
139
            Offering.id == Enrolment.offering_id,
 
140
            Subject.id == Offering.subject_id).config(distinct=True)
 
141
 
 
142
    @property
135
143
    def active_enrolments(self):
136
144
        '''A sanely ordered list of the user's active enrolments.'''
137
145
        return self._get_enrolments(True)