use_table=false?

9 views
Skip to first unread message

rostoQ

unread,
Jul 11, 2008, 8:48:15 AM7/11/08
to web.py
I have web.py 0.23,
The following code dosent make the Form displayed in <divs>, did i
placed the use_table argument right?

addform = form.Form(
form.Dropdown("master",
form.Textbox("titel"),
form.Textarea("content"),
use_table=False
)

andrei

unread,
Jul 11, 2008, 11:44:24 AM7/11/08
to web.py
i've never heard of this option. does it exist at all?

On Jul 11, 4:48 pm, rostoQ <koreanisches.mienensuchk...@yahoo.de>
wrote:

rostoQ

unread,
Jul 11, 2008, 8:36:34 PM7/11/08
to web.py

Aaron Swartz

unread,
Jul 12, 2008, 8:37:03 AM7/12/08
to we...@googlegroups.com

Dude, that's your own email! What would that argument even do?

rostoQ

unread,
Jul 12, 2008, 10:28:47 AM7/12/08
to web.py
Shame on me, thats awkward, i meant another thread, and in this thread
someone just talks about suggesting the feature, if i get him right
after re-reading:
http://groups.google.com/group/webpy/browse_thread/thread/bf10603a92edf330/3783d5a5f33455e2?lnk=gst&q=use_table#3783d5a5f33455e2

Anyway, i think there *should* be the suggested feature (it makes the
forms not render in ugly tables but in css-stylable <div> containers
with own classes).

For now, if you want perfectly-styled forms, one probalby shouldn't
use form.py....

On Jul 12, 2:37 pm, "Aaron Swartz" <m...@aaronsw.com> wrote:
> > according to this thread it should exist:
> >http://groups.google.com/group/webpy/browse_thread/thread/cdeb59f4dc3...

Eric Talevich

unread,
Jul 12, 2008, 11:56:41 AM7/12/08
to web.py
Looks like Greg even submitted the code for it:
http://groups.google.com/group/webpy/msg/04b6ba1d4313a143

I don't see this issue mentioned in the bug tracker or blueprints,
though.

Justin Davis

unread,
Jul 12, 2008, 6:56:26 PM7/12/08
to web.py
I realize this probably isn't the solution that you're looking for,
but I when I want a different form look (for instance having the form
label be a block element, instead of 'inline' like how the table
forces), I just create a subclass of the form. For example:

from web import form

class LiForm(form.Form):
def render(self):
out = '<ul class="li_form">'
out += self.rendernote(self.note)
for i in self.inputs:
out += ' <li><label for="%s">%s</label>' % (i.id,
i.description)
out += '<span id="note_%s">%s</span></li>\n' % (i.id,
self.rendernote(i.note))
out += '<li>'+i.pre+i.render()+i.post +'</li>'
out += "</ul>"
return out

It would be cool if we could support different form renderings
natively -- django does this as methods on the form instance -- but
this works for now.

Cheers,
Justin

rostoQ

unread,
Jul 13, 2008, 5:56:31 AM7/13/08
to web.py
Thank you for that code! Works great, and wouldnt have been able to
fiddle it out like this by myself :/.
Would really be great if this would be easier.
Reply all
Reply to author
Forward
0 new messages