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

So why is the URL
http://localhost:7654/widgets/turbogears.widgets.AjaxGrid/update
instead of

because the example widget does that, please note that class AjaxGridDesc(CoreWD): is what is display in the example, and you should use that as a guide on how to use it, the idea behind using the classname is that the toolbox will never confuse that sample widget for another.

http://localhost:7654/widgets/update

because if two sample widgets have the update method they will crash

what does the full_class_name have to do with it?

in a "real use" absolutely nothing, your real widget will be something like this.
class AjaxGridDesc(CoreWD):
name = "MyWidget"

#to stuff to create the content.

def __init__(self, *args, **kw):
super(AjaxGridDesc, self).__init__(*args, **kw)
self.for_widget = AjaxGrid(
refresh_url = "widgets/update"
defaults = dict(),
)
self.update_count = itertools.count()
@expose(format='json')
def update(self):
return dict(
headers = ["something","otherthing"],
rows = list(someVar),
)
#update = expose(format="json")(update) <--- that is there because decorators don't exist in py2.3
and remenber that class should be in your controller.py and you must create an instance of it, somewhere.

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