ToscaWidgets, @validate, Restful URL question

2 views
Skip to first unread message

cd34

unread,
Nov 2, 2009, 4:46:33 PM11/2/09
to ToscaWidgets-discuss
I have an application where I have a url of:

/widgets

From that list, you can view the detail of an individual widget with:

/widget/1

This page displays widget_header and widget_detail lines. The form at
the bottom allows the user to add a new detail line.

@validate(widget_form, error_handler='widget')

However, when I need to do validation on the form submission on the
url /widget/1, error_handler is set to 'widget', which causes the page
generation to fail because it doesn't pass id, and, request.params is
empty at this point. Since the form is adding a detail line to a
header record, using RestController doesn't seem to really fit the
requirements unless I am not implementing RestController correctly.

How have others handled this situation without resorting to a modal
form?

Diez B. Roggisch

unread,
Nov 2, 2009, 4:59:40 PM11/2/09
to toscawidge...@googlegroups.com
cd34 schrieb:

All you need is to pass the ID of the head-object as hidden formfield.
Might require some creative proxying, but shouldn't be to hard.

Diez

cd34

unread,
Nov 2, 2009, 6:03:15 PM11/2/09
to ToscaWidgets-discuss


On Nov 2, 4:59 pm, "Diez B. Roggisch" <de...@web.de> wrote:
> All you need is to pass the ID of the head-object as hidden formfield.
> Might require some creative proxying, but shouldn't be to hard.

Did that, as listed above, request.params is empty when the validate
error handler is called.

Diez B. Roggisch

unread,
Nov 2, 2009, 6:46:29 PM11/2/09
to toscawidge...@googlegroups.com
cd34 schrieb:

You should be able to locate it through your_widget.value_at_request I
think.

Diez

cd34

unread,
Nov 2, 2009, 10:51:30 PM11/2/09
to ToscaWidgets-discuss
On Nov 2, 6:46 pm, "Diez B. Roggisch" <de...@web.de> wrote:
> You should be able to locate it through your_widget.value_at_request I
> think.

request.environ['webob._parsed_post_vars'][0]['widget_id']

contained the value. I couldn't find anything in the wsgi response
that contained the widget name or value_at_request.
Reply all
Reply to author
Forward
0 new messages