On May 8, 2007, at 3:20 PM, Timur Izhbulatov wrote:
> Hi everyone,
>
> I'm trying to find out why automatic decoding of request parameters
> [1] is not
> working. I have a freshly installed TurboGears 1.0.2.2 and a small
> test case
> ripped from turbogears/widgtes/tests/test_nested_widgets.py
> (attached).
>
> I get the following output from the test case:
>
> <module 'turbogears.widgets' from '/home/aquarium/lib/python/
> TurboGears-1.0.2.2-py2.3.egg/turbogears/widgets/__init__.pyc'>
> <form class="tableform" method="post" name="myform">
> <table cellpadding="2" cellspacing="0" border="0">
> <tr class="even">
> <th>
> <label class="fieldlabel" for="name">name</label>
> </th>
> <td>
> <input name="name" type="text" id="name"
> class="textfield">
> </td>
> </tr><tr class="odd">
> <th>
> <label class="fieldlabel" for="age">age</label>
> </th>
> <td>
> <input name="age" type="text" id="age"
> class="textfield">
> </td>
> </tr><tr class="even">
> <th>
> <label class="fieldlabel" for="sub">sub</label>
> </th>
> <td>
> <fieldset class="fieldset" id="sub">
> <div>
> <label class="fieldlabel" for="name">name</label>
> <span><input name="name" type="text" class="textfield"
> id="name"></span>
> </div><div>
> <label class="fieldlabel" for="age">age</label>
> <span><input name="age" type="text" class="textfield"
> id="age"></span>
> </div><div>
> <label class="fieldlabel" for="sub2">sub2</label>
> <span><fieldset class="fieldset" id="sub2">
> <div>
> <label class="fieldlabel" for="name">name</label>
> <span><input name="name" type="text" id="name"
> class="textfield"></span>
> </div><div>
> <label class="fieldlabel" for="age">age</label>
> <span><input name="age" type="text" id="age" value="22"
> class="textfield"></span>
> </div>
> </fieldset></span>
> </div>
> </fieldset>
> </td>
> </tr>
> <tr>
> <td> </td>
> <td><input type="submit" class="submitbutton"></td>
> </tr>
> </table>
> </form>
>
> Traceback (most recent call last):
> File "test.py", line 63, in ?
> TestNestedWidgets().test_display()
> File "test.py", line 35, in test_display
> assert (re.compile('.*'.join([value_p, name_p])).search(output) or
> AssertionError
>
> Any ideas?
Being honest, I've got no idea of the root cause of this :(
I believe this is related somehow to the way TG widgets use
cherrypy.request to store the path of nested widgets. I've tried
running your tests and it fails... however, it's almost identical to
turbogears.widgets.tests.test_netsed_widgets:TestNestedWidgets which
passes in my system and nested widgets seem to work properly in apps.
The weird thing is that if I run that test standalone (nosetests
turbogears.widgets.tests.test_nested_widgets) it fails... :/ Is this
giving you trouble in an app in the context of a request?
Alberto
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---