[Twisted-web] using freeform bind_* instead of subclass TypedInterface

Richard Wall m-lists at the-moon.net
Sat Jul 16 08:33:32 MDT 2005


On 16/07/05 12:47 Paul Reznicek wrote:
> Hello all,
> using "bind_*" is very simple, nice and usable (try the example),

Yep, I prefer it too.

> but I have several questions (see below):

I've attached an example which (I think) addresses all these questions.
Also available at...
http://deadbeefbabe.org/paste/1124

> 1. how to omit the automatically generated submit button "Call"

Instead of returning a list of tuple(label, annotated types) return an
instance of formless.MethodBinding, whose constructor accepts an
action="My button label" kw argument

> 2. how to change (or skip) the displayed form name "Two _fields", resp.
> the whole frame ?
> 3. how to get all fields and buttons into one line, resp. one table row ?

In the example I have done this by providing my own form template
'Pattern', but another way might be to register your own
MethodBindingRenderer adaptor based on the one in formless/webform.py.

There has been talk on #twisted.web of removing the slot system and
encouraging use of render_ methods instead, so this example may need
altering in future. Perhaps Donovan or one of the other developers might
comment on whether there is a better / more future proof way of creating
custom forms. I might just have not understood what was being talked
about though. :-)

You might also want to look at pollenation's 'forms' system which works
at a lower level than formless / freeform...
http://forms-project.pollenation.net/

Hope that helps.
-- 
Richard Wall
-------------- next part --------------
A non-text attachment was scrubbed...
Name: customform.tac.gz
Type: application/x-gzip
Size: 1662 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050716/6e793089/customform.tac.bin


More information about the Twisted-web mailing list