Thank you kindly, James; and thank you for your book. :) On Aug 7, 5:35 am, James Gardner <[email protected]> wrote: > Hi waugust, > > Thanks. There are actually two problems here: > > * A bug in form.end_with_layout() > * A bug where the example LiteralForm in the docs is out of date > > I've made a new release 3.0.2 to fix them both. If you get the source > distribution and look at test/pylons_test.py you should see the > example working correctly. > > Mike: Thanks for bringing this to my attention. > > Cheers, > > James > > On Aug 6, 6:48 pm, waugust <[email protected]> wrote: > > > > > 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.
