On 1/12/07, Joseph Tate <[EMAIL PROTECTED]> wrote: > > You're missing the point. This is not about what json can and can't > do, it's making the controller know about the output format for the > data. What if we come up with a new CSV output format? What if it's > RSS? What about XMLRPC? The point is that the controller shouldn't > know or care. It just spits out data, the view determines what it > looks like when it's returned from the server. Widgets are currently > for encapsulating display and formatting logic for HTML output, so work > in this paradigm if instantiated outside of the controller. >
No, I understand the point, I was merely pointing out a possible workaround on a per project basis. :) The above issue is one of the reasons I make sure none of my Widgets require JS that can't be added to the template by hand - I instantiate all my widgets outside of controllers and add them to the default providers so they don't have to be passed by a controller for them to be used in the view. Maybe, for TG2, there should be a decorator to handle this that can inject widgets into the template namespace when actually *using* a template and just ignore them for other formats, i.e. JSON. -- Lee McFadden blog: http://www.splee.co.uk work: http://fireflisystems.com skype: fireflisystems --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
