[Twisted-web] Freeform localisation and buttons (Was: Freeform default button label)

Richard Wall m-lists at the-moon.net
Mon Jul 18 15:36:09 MDT 2005

On 18/07/05 19:16 Paul Reznicek wrote:
> I see a lot of usecases for more buttons, one I'm writing now:
> DB record browser/editor, where are at least
>   [previous|next|search] + [reload|new|copy|save|delete]
> are necessary.
> You are right, it is possible to do this with hyperlinks,
> but this allow users to bookmark every of this actions,
> and to use the browser's back button with undesired effects.

Paul, you know your webapp best... but in my experience this could also
be achieved with a single submit button and supplementary hyperlinks.
Assuming that the page above is a form representing the state of a
single record...

Next / Previous - hyperlinks *because* that will allow the user to
bookmark particular pages.

Search - a submit button but associated with a separate search form.

Save - The single submit button to POST the form. Formless does an http
redirect after a successful post so the back button shouldn't be a problem.

*Cancel - I hyperlink to the previous page or to a datagrid / index of
records. Although you didn't mention it, I think it's a good to provide
users with a way of escaping from the form.

The following would only be shown for saved records...

Reload - a hyperlink to the current resource. To discard changes made to
the data. (Although a simple <input type="reset"> might do that

New - Hyperlink to a blank form.

Copy - Hyperlink to a form prefilled with the data of the source record,
but unsaved.

Delete - a hyperlink to a deletion confirmation page displaying the
record that is to be deleted. With a single submit button to confirm
deletion, and which http POSTs so that the deletion url cannot be

> To extend the discussion about freeform:
> - please also pay attention to the fact, that all labels, errors
> messages, tips, etc. should be easy localizable.

I've never done a foreign language site, but I can see that this would
be useful. I just tried hacking the i18n example a bit and have found
that you can use an i18n.Translator as the label, requiredFailMessage
parameters to the eg annotate.String. Have attached tgz archive of the
app. It seems really cool, but I haven't had time to figure out how to
generate the .mo files from the .po files. It would be good if that
could be done automatically when the .po files change. Maybe you'll
better understand that side of things.

> - error messages can vary depending on field contents:
> integer error is from user's point of view not a numeric error,
> (i.e. "please enter your age as whole number")

You might get away with annotate.String(requiredFailMessage="please
enter your age as whole number")

More likely, you'll want to create your own library of formless types,
processors and renderers. For ideas see second attachement.

Richard Wall
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i18n-form-fields.tgz
Type: application/x-compressed-tar
Size: 2118 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050718/2f5bac02/i18n-form-fields.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rwall-formless-types.tgz
Type: application/x-compressed-tar
Size: 4848 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050718/2f5bac02/rwall-formless-types.bin

More information about the Twisted-web mailing list