thank you for the answer moritz. I thought the same thing, but for some reason kw (nor page) are available in the template.
I will upload a mini example and post here once this is done. Thank you so much for the help! On Friday, July 26, 2013 12:17:57 PM UTC-4, Moritz Schlarb wrote: > > In your code for self.widget you return dict(w=w,kw=kw,page=self.page). > > Since this is the dict that gets passed to your template engine, you > should have kw there, except you changed something on your code in the > meantime... > > It would be great if you could maybe create a minimal (not-)working > example of what and how you are trying to achieve and dump it to > gist.github.com maybe. > Then we could provide some more solid support.... > > Am Freitag, 26. Juli 2013 18:13:48 UTC+2 schrieb Dennis Backhaus: >> >> The .display call happens in the template. >> How do I get the existing dictionary from the controller into my >> template? Clearly I cannot just say: >> >> <div py:replace="w.child.display(value=kw)"/> >> >> because my template does not know about kw. >> >> This is what my question is about the whole time. >> >> On Friday, July 26, 2013 11:32:58 AM UTC-4, Alessandro Molina wrote: >>> >>> On Fri, Jul 26, 2013 at 5:00 PM, Dennis Backhaus < >>> [email protected]> wrote: >>> >>>> I am not sure if my english is too bad to explain my point here. I will >>>> try again with code: >>>> >>>> unit = SingleSelectField( >>>> label="Unit", >>>> options=['seconds','minutes','hours','days','weeks'], >>>> value='days' >>>> ) >>>> >>>> ^^ This is how I can pre-fill a SelectField currently. >>>> >>>> arm_id = TextField( >>>> label="Arm ID", >>>> attrs=dict(disabled=True), >>>> value=1444742 >>>> ) >>>> >>>> ^^ This is how I can pre-fill a TextField. >>>> >>> >>> That provides a default value. It's not actually what I meant for >>> prefilling :D >>> >>> >>>> What I do not know is how to get the parameter/that dictionary into my >>>> form. Do I do this in the class UserForm? Do I do this in the template? I >>>> do not know. This is why I am posting here. >>>> >>> >>> You just pass them as the "value" argument to the form .display call. >>> Here again, look at the first documentation link I provided you: >>> http://turbogears.readthedocs.org/en/tg2.3.0b2/cookbook/TwForms.html#displaying-forms >>> The third block of code, where form.display is called. >>> >>> >> -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/turbogears. For more options, visit https://groups.google.com/groups/opt_out.

