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

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: William Grant
  • Date: 2009-01-20 02:49:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: grantw@unimelb.edu.au-20090120024922-6eb86loc19qwcldh
ivle.database.Enrolment: Add a groups attribute, containing groups of which
    this user is a member in this offering.
www/apps/userservice: Use Storm instead of get_enrolment_groups.
ivle.db.get_enrolment_groups: Kill. Unused.

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
    notes = Unicode()
276
276
    active = Bool()
277
277
 
 
278
    @property
 
279
    def groups(self):
 
280
        return Store.of(self).find(ProjectGroup,
 
281
                ProjectSet.offering_id == self.offering.id,
 
282
                ProjectGroup.project_set_id == ProjectSet.id,
 
283
                ProjectGroupMembership.project_group_id == ProjectGroup.id,
 
284
                ProjectGroupMembership.user_id == self.user.id)
 
285
 
278
286
    __init__ = _kwarg_init
279
287
 
280
288
    def __repr__(self):