class MyController(BaseController):
def index(self):
# Return a rendered template
#return render('/test.mako')
# or, return a response
return ''
Why does the function “index” have “self”?
I got this code from Pylons controller
It’s a member function (a function that’s part of a class), so when it’s called, the object it was called on is automatically passed as the first argument.
For example:
would call
indexwithselfequal toc.selfis the standard name, but you can call it anything you want