You might find it useful to run web2py in a shell so you can experiment and 
see what objects and HTML are generated with forms.

python web2py.py -S myapp/default -M -N

That will start a Python shell in the environment of the default.py 
controller of myapp (including running the models). You can then call any 
of the functions in default.py to inspect their output, as well as access 
the entire web2py API to experiment. To see the html generated by a helper 
object (including a FORM or SQLFORM object), just 'print' it (or call it's 
.xml() method). For example:

>>> form = SQLFORM.factory(Field('primary_email_choice_new', 
widget=SQLFORM.widgets.radio.widget,
requires=IS_IN_SET({'Work' : 'Work', 'Home' : 'Home'}), default='Work'))
>>> print form
<form action="" enctype="multipart/form-data" method="post"><table><tr 
id="no_table_primary_email_ch
oice_new__row"><td class="w2p_fl"><label 
for="no_table_primary_email_choice_new" id="no_table_primar
y_email_choice_new__label">Primary Email Choice New: </label></td><td 
class="w2p_fw"><table class="s
tring" id="no_table_primary_email_choice_new" 
name="primary_email_choice_new"><tr><td><input id="pri
mary_email_choice_newHome" name="primary_email_choice_new" type="radio" 
value="Home" /><label for="p
rimary_email_choice_newHome">Home</label></td></tr><tr><td><input 
checked="checked" id="primary_emai
l_choice_newWork" name="primary_email_choice_new" type="radio" value="Work" 
/><label for="primary_em
ail_choice_newWork">Work</label></td></tr></table></td><td 
class="w2p_fc"></td></tr><tr id="submit_r
ecord__row"><td class="w2p_fl"></td><td class="w2p_fw"><input type="submit" 
value="Submit" /></td><t
d class="w2p_fc"></td></tr></table></form>

Anthony

On Monday, November 28, 2011 1:46:57 PM UTC-5, Constantine Vasil wrote:
>
> It depends from the development environment. I am working with GAE and it 
> is very tricky to debug when using GAE.
>
> Controller will be fine for me after I generate the HTML to see what it is 
> doing.
> To understand it how it works we need more examples in the doc.
>
> Before that I need to work with the debugger to see what happens.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

Reply via email to