On Jul 20, 2010, at 6:54 , Diez B. Roggisch wrote: >>> I don't get it. Why don't you just return d? Everything that is supposed >>> to be template-only, e.g. widgets or helper functions or no idea what >>> else is supposed to go to the tmpl_context anyway. Precisely because >>> otherwise rendering json would mean rendering cruft. >> >> If I return d and it's a dictionary, I don't know how to refer to it in the >> template. > > By the keys of the dictionary. As you already do, with an unneeded layer of > indirection.
The object has a lot of fields. I wanted to be able to get at the dictionary as a whole and iterate through its keys and values to display them, rather than manually typing it all out. But there doesn't appear to be a way of getting at just that dictionary of values from the template unless I first wrap it in an outer dictionary. Also: is there a better way to get the fields of the object as a dict? -- 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.

