On Jan 29, 2008 1:16 PM, Foo Bar <[EMAIL PROTECTED]> wrote: > > Hello! > > I recently inherited a small TG project and need to make a couple of > changes to it now. While I am trying to learn about TG as I go, I have > now come across a particular problem for which I might need some > assistance. > > Actually, there are two questions: > > 1. I use the DataGrid widget to display a table in a form. It appears > to me as if the various columns can only be filled with values read > from the SQAlchemy objects. I need to add some more or less static, or > even computed values to as columns as well, though. How can I specify > that? I guess I could provide specific object methods for that, so > that the widget can use them. However, logically, those values are not > really part of the object. > http://lucasmanual.com/mywiki/TurboGears#head-ba91d42a569b347f9886341db15e317681037816 Check this doc. 'DataGrid and SqlAlchemy Example' is probobly what you have. For the calculations you can modify your code as it is in the 'DataGrid Example with static content', using lambda function.
> 2. The grid in question lists a couple of items. At the bottom I > would like to have an empty field and an 'Add' item, which allows > users to add another item to the list. I have that working so far. > Once added, the page is being redisplayed and shows one more item as > intended. But next to each item I would now like to display a list of > possible 'actions' (see point 1), one of them being 'delete' for > example. It appears to me that TG's form handling would expect the > button at the bottom to be pressed, though. Is there a way to have > multiple exits out of the form? One being the button, the other being > one of the action links next to each item? > Not sure about this. AJAX style maybe? -- -- VMware Server On Debian http://wiki.debian.org/Manual-Howto#head-c9e998d4806797452cd58fce417b6fb00fbc60be TurboGears from start to finish: http://www.lucasmanual.com/mywiki/TurboGears --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

