I'm trying to pass a default value through web.input in case the key is not
given in the URL parameters.
Here's the relevant code:
class scores:
def GET(self):
i = web.input(weekid=1)
s = db.select('schedule', i, where="week = $weakid", order="gameid")
return render.scores(i.weakid, s)
This works fine as long as I'm passing a key in the URL
(www.myurl.com/scores?weakid=10), but if i leave the key out and go to
www.myurl.com/scores i get the following error:
NameError: name 'weakid' is not defined
>
This seems like something extremely simple, and I've probably made a stupid
mistake somewhere, but I've read through all the docs and it seems like I'm
doing everything correctly.
Any ideas?
NameError: name 'weakid' is not defined
NameError: name 'weakid' is not defined
NameError: name 'weakid' is not defined
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.