On 12/3/06, Matt Wilson <[EMAIL PROTECTED]> wrote: > > So, if I have a function f(a, b), what TG work do I have to do expose > this function so that people can do gets like > > http://example.com/f/a/1/b/2
The standard way to do that in TG would be to use the url: http://example.com/f/1/2 And use positonal parameters in your controller so def f(a,b): pass > Which would be a request that I execute f(a=1, b=2) and return the > results? > > Do I just need to put **kwargs in my controllers.py definition for f? Actually using the URL you provided, your controller object f would get four positional parameters. **kwargs would suck up any key-value pairs included in the HTTP Post or HTTP Get request. > Any links explaining how to use REST with TG would be very appreciated. There's discussion of this in the CherryPy chapter of the TurboGears book, and I seem to remember a page on the wiki. I don't have time to go looking for it right now, but if you can't find it let me know and I'll search it out. --Mark --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---

