On 6/5/06, Randy <[EMAIL PROTECTED]> wrote:

I've noticed when using the widget browser in the toolbox that I can go
to

http://localhost:7654/widgets/turbogears.widgets.AjaxGrid/update

http://trac.turbogears.org/turbogears/browser/trunk/turbogears/widgets/big_widgets.py#L316

311     def update(self):
312         return dict(
313             headers = ["N", "fact(N)"],
314             rows = list(self.facgen(self.update_count.next())),
315         )
316     update = expose(format="json")(update)

remenber that decorators are just a fancy way of calling a function with another so l316 is the equivalent of @expose

and get json data for the AjaxGrid widget, and I can go to

http://localhost:7654/widgets/turbogears.widgets.LinkRemoteFunction/search_linkrf/N

and see all the states starting with 'N', and many similar things can
be done with the other widgets.

same thing as above

My question is, how are these functions being "exposed"?

this is exactly the same way 

I was under the impressions that exposing URLs had to occur in controller classes.

actually the widget is on your controller remenber the only thing that should be done to a widget on the template is call display.



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to