Thanks Hermann and Aaron's - it's making sense. This is what I have
now:
urls = (
'/', 'index',
'/returnResults', 'returnResults',
)
class index():
def GET(self):
web.header("Content-Type", "text/html;
charset=iso-8859-1")
print render.ac()
return
def POST(self):
i = web.input()
web.debug(i)
q = i.q
limit = i.limit
web.seeother('/returnResults')
return
Yes, so far?
Next, using 'q' I search a database and/or list and return 'results'
back to the JQuery autocomplete. Now, is this done with another
GET(self) within class index() or as a separate class? I assume a
separate class returnResults
class returnResults():
def GET(self):
# using 'q' get results = subset of data
results = simplejson.dumps(subsetData)
print results
return
Does this look okay?
On Apr 7, 8:25 am, "Aaron Swartz" <[EMAIL PROTECTED]> wrote:
> > '/', 'index',
>
> [...]
>
> > def POST(self, url_bit): # ac is sending the string "/ac/?
>
> Here's the rule: For every block in parentheses in the URL up top, you
> need one extra argument in the function definition down below. Since
> your URL up top has no parentheses, the only argument you need down
> here is self.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---