I'm using FormBuild 3 to build my forms. I have my form in a forms
module with a return function to a controller where I put it into a
tmpl_context variable and pass it to my mako template.
I copied James' function to make the return literal, though upon
rendering, everything comes out fine except for
"form.end_with_layout()" which gives "</table></form>".
James' class:
from formbuild import Form
from webhelpers.html import literal
class LiteralForm(Form):
def __getattribute__(self, name):
if name in ['value', 'option', 'error', 'checked', 'flow']:
return Form.__getattribute__(self, name)
def make_literal(*k, **p):
return literal(getattr(Form, name)(self, *k, **p))
return make_literal
I don't do anything odd on the form:
from <myproj>.forms import LiteralForm
from pylons import url
form = LiteralForm(
value = {
'file':''
},
error= {
'file_upload':u'Please select a file for
processing.'
}
)
lines = [
form.start_with_layout(
url(controller='template', action='process'),
table_class='upload_form'
),
form.row('<h2>Upload file for processing</h2>'),
form.field(
label="File",
type='file',
name='file'
),
form.action_bar(
form.submit(name='action', value='Submit')
),
form.end_with_layout(),
]
def returnform():
return lines
Anybody got an idea?
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.