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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/projectservice.py

  • Committer: Matt Giuca
  • Date: 2010-02-11 05:54:45 UTC
  • Revision ID: matt.giuca@gmail.com-20100211055445-151qrs4xczzl5rns
Docs: Completed Tour of IVLE (finished Admin section). Apologies for the mess on the previous commit -- committed an unfinished document.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    
31
31
    Add new, delete, edit functionality is given here."""
32
32
    template = "templates/projectset_fragment.html"
33
 
    
34
 
    def __init__(self, req, subject, year, semester, projectset):
35
 
        self.context = req.store.find(ProjectSet,
36
 
            ProjectSet.id == int(projectset),
37
 
            ProjectSet.offering_id == Offering.id,
38
 
            Offering.subject_id == Subject.id,
39
 
            Subject.short_name == unicode(subject),
40
 
            Offering.semester_id == Semester.id,
41
 
            Semester.year == unicode(year),
42
 
            Semester.semester == unicode(semester)).one()
43
 
        
44
 
        if self.context is None:
45
 
            raise NotFound()
46
33
 
47
34
    def _project_url(self, project):
48
35
        return "/subjects/%s/%s/%s/+projects/%s" % \
68
55
        req.store.flush()
69
56
    
70
57
        self.template = "templates/project_fragment.html"
 
58
        self.ctx['req'] = req
71
59
        self.ctx['project'] = new_project
72
 
        self.ctx['project_url'] = self._project_url(new_project)
73
60
 
74
61
        return {'success': True, 'projectset_id': self.context.id}
75
 
 
76
 
class ProjectRESTView(XHTMLRESTView):
77
 
    """Rest view for a project."""