Kevin Horn wrote:
> Can anyone point to an example of how the positional parameter support
> actually ended up working? I couldn't find anything on the wiki or through
> Google, except for trac ticket #73...which isn't very clear.
On a quickstarted project:
---8<--- snip ---8<--- snip ---8<--- snip ---8<--- snip ---8<---
class Root(controllers.RootController):
@expose(template="agt.templates.welcome")
def index(self):
import time
log.debug("Happy TurboGears Controller Responding For Duty")
return dict(now=time.ctime())
class Obj(controllers.Controller):
class SubObj(controllers.Controller):
@classmethod
@expose()
def method1(self, arg1, arg2, arg3):
return "arg1: %s<br>arg2: %s<br>arg3: %s" % (arg1,
arg2, arg3)
@classmethod
@expose()
def method2(self, *args, **kw):
return "args: %s<br>kw: %s" % (args, kw)
---8<--- snip ---8<--- snip ---8<--- snip ---8<--- snip ---8<---
Then try to hit:
http://localhost:8080/Obj/SubObj/method1/arg1/arg2/arg3
http://localhost:8080/Obj/SubObj/method2/arg1/arg2/arg3?kw1=data1&kw2=data2&kw3=data3
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---