Hello again;
I want to render a [textbox].[textbox] on my app; and i was using
web.form.Form(
web.form.Textbox('domain', description="Domain name:",
post="."+web.form.Textbox('tld').render()),
)
But, only for testing purposes, i just wrote this crap:
import types
class MyForm(web.form.Form):
def render(self):
out = ''
out += self.rendernote(self.note)
out += '<table>\n'
for i in self.inputs:
if type(i) == types.TupleType:
out += ' <tr><th><label for="%s">%s</label></th><td>'
% (i[0].id, web.net.websafe(i[0].description))
for i2 in i:
out += i2.pre+i2.render()+i2.post
out += "</td></tr>\n"
else:
out += ' <tr><th><label for="%s">%s</label></th>' %
(i.id, web.net.websafe(i.description))
out += "<td>"+i.pre+i.render()+i.post+"</td></tr>\n"
out += "</table>"
return out
what i can use to write something like:
MyForm(
(
web.form.Textbox('domain', description="Domain name:",
post="."),
web.form.Textbox('tld', description="Extension:")
)
)
which is much clear to me; if anyone likes it...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---