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

« back to all changes in this revision

Viewing changes to ivle/db.py

  • Committer: William Grant
  • Date: 2009-01-20 02:36:42 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: grantw@unimelb.edu.au-20090120023642-rbgmprjihzii95zc
www/apps/userservice: Port create_group to Storm.
ivle.db.get_offering_info: Kill. Unused.

Show diffs side-by-side

added added

removed removed

Lines of Context:
452
452
            return query
453
453
        return self.db.query(query).dictresult()
454
454
 
455
 
    # PROJECT GROUPS
456
 
 
457
 
    def get_offering_info(self, projectsetid, dry=False):
458
 
        """Takes information from projectset and returns useful information 
459
 
        about the subject and semester. Returns as a dictionary.
460
 
        """
461
 
        query = """\
462
 
SELECT subjectid, subj_code, subj_name, subj_short_name, url, year, semester, 
463
 
active
464
 
FROM subject, offering, semester, project_set
465
 
WHERE offering.subject = subject.subjectid AND
466
 
    offering.semesterid = semester.semesterid AND
467
 
    project_set.offeringid = offering.offeringid AND
468
 
    project_set.projectsetid = %d;"""%projectsetid
469
 
        if dry:
470
 
            return query
471
 
        return self.db.query(query).dictresult()[0]
472
 
 
473
455
    def close(self):
474
456
        """Close the DB connection. Do not call any other functions after
475
457
        this. (The behaviour of doing so is undefined).