~ellimistd/lessonplan/trunk

« back to all changes in this revision

Viewing changes to controllers/default.py

  • Committer: David Reich
  • Date: 2010-07-15 22:25:44 UTC
  • Revision ID: ellimistd@gmail.com-20100715222544-ftxb7p3pc20sybx8
Finally, multiform submission works! extensibly too

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
                if form.accepts(request.vars,session):
18
18
                        session.WIPplanid = form.vars.id
19
19
                        session.nextWIPstep = "coreinfo"
20
 
                        print 'hi'
21
20
                        response.flash = 'Topic accepted, begin filling the form'
22
21
                        redirect(URL(r=request, f='new'))
23
22
                else:
30
29
                if form.accepts(request.vars, session):
31
30
                        session.coreinfoid=form.vars.id
32
31
                        response.flash = "Core Information accepted"
33
 
                        session.nextWIPstep = 'objectives'
34
 
                        plan = db(db.WIPplan.id==session.WIPplanid).select()[0]
35
 
                        plan.coreinfo=db(db.CoreInfo.id==session.coreinfoid).select()[0]
 
32
                        session.nextWIPstep = False
 
33
                        plan = db(db.WIPplan.id==session.WIPplanid)
 
34
                        plan.update(coreinfo = session.coreinfoid)
 
35
                        print plan
36
36
                        redirect(URL(r=request, f='new'))
37
37
                return dict(form=form,pagetitle=pagetitle)
38
38
                        
39
39
        
40
40
def show():
41
41
        plan = db(db.WIPplan.id==request.args(0)).select()[0]
42
 
        plan.coreinfo=db(db.CoreInfo.id==session.coreinfoid).select()[0]
43
42
        print plan
44
43
        return dict(plan=plan)
45
44