ron banks
rebcoair at cfl.rr.com
Wed Jul 11 08:34:51 EDT 2007
Have been doing fine with mod_python and in the process of learning it. I can see the wisdom of utilizing templates. Here's where I establish my newbie status. Can someone tell me what I am doing wrong, how I should be doing it, or why I am not getting this. Be gentle, I set up my first web site using psp only recently and I have no experience with templates. Newbie status established. I have a function that builds the html to create a calendar that I will later populate with scheduling records. I'm just trying to get a calendar that the user can navigate back and forth by month so I will have a couple of buttons that will javascript a string with a date, "2007,7,11" using ajax to set a session variable. Then I want to run the same calendar function that will pick up this session variable and build a calendar based on the new date. I trying to figure out how to do this with templates. Here's an example: -------------------------Month.psp------------------------- <% from mod_python import apache, psp from loadCalendar import setStrDate %> <%=setStrDate(req)%> ----------------loadCalendar/setStrDate---------------- def setStrDate(req): if not hasattr(req, 'session'): session = initSession(req) strDate = "" else: session = Session.Session(req) strDate = getSessionVariable(session, 'currDate') req.content_type = 'text/html' tmpl = psp.PSP(req, filename='Month.tmpl') tmpl.run(vars = {'strDate': strDate}) return "" ------------------------Month.tmpl------------------------- <% from mod_python import apache, psp from loadCalendar import loadMonth, strDate %> <%=loadPan()%> <%=loadMonth(req, =strDate)%> ----------------Traceback from psp.py------------------- File "/var/www/html/TaskMaster/Month.tmpl", line 21 req.write(""" """,0); req.write(str(loadPan()),0); req.write(""" """,0); req.write(str(loadMonth(req, =strDate)),0); req.write(""" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070711/a4fbc7a1/attachment.html
|