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

« back to all changes in this revision

Viewing changes to lib/common/db.py

  • Committer: dcoles
  • Date: 2008-08-10 02:33:32 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1004
Groups: Now you can add people to a group as well as creating groups from the 
/groups page. Note: Still no way of removing people yet and probably should use 
transactions on a few of the database calls (in case creating the repository 
fails).

Show diffs side-by-side

added added

removed removed

Lines of Context:
910
910
            result['active'] = _parse_boolean(result['active'])
911
911
        return results
912
912
 
 
913
    def get_offering_members(self, offeringid, dry=False):
 
914
        """
 
915
        Gets the logins of all the people enroled in an offering
 
916
        """
 
917
        query = """\
 
918
SELECT login
 
919
FROM login, enrolment
 
920
WHERE login.loginid = enrolment.loginid AND
 
921
    enrolment.offeringid = %d;"""%offeringid
 
922
        if dry:
 
923
            return query
 
924
        return self.db.query(query).dictresult()
 
925
 
 
926
 
913
927
    def get_enrolment(self, login, dry=False):
914
928
        """
915
929
        Get all offerings (in IVLE) the student is enrolled in.