Google Groups Home
Help | Sign in
CompoundFormField widget and validation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Patrick Lewis  
View profile
 More options Nov 23 2007, 10:41 am
From: Patrick Lewis <patrickhle...@gmail.com>
Date: Fri, 23 Nov 2007 07:41:36 -0800 (PST)
Local: Fri, Nov 23 2007 10:41 am
Subject: CompoundFormField widget and validation
Hi, I'm having some trouble with validating a CompoundFormField, and
I'm not sure how to proceed. As an example of my problem, take this
controller:

http://paste.turbogears.org/paste/1776

This url succeeds (with validation):
http://localhost:8080/save?mywidget.hidden=1&mywidget.number=2

and these fail validation (as they should), redirecting back to index
http://localhost:8080/save?mywidget.hidden=1&mywidget.number=foo
http://localhost:8080/save?mywidget.hidden=&mywidget.number=2
http://localhost:8080/save?mywidget.number=2

But this url doesn't fail at all, and goes straight to the save
method, apparently bypassing validation.

http://localhost:8080/save

Any thoughts as to what's going on here?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile
 More options Nov 23 2007, 11:19 am
From: "Diez B. Roggisch" <de...@web.de>
Date: Fri, 23 Nov 2007 17:19:12 +0100
Local: Fri, Nov 23 2007 11:19 am
Subject: Re: [TurboGears] CompoundFormField widget and validation
Patrick Lewis schrieb:

Maybe trying to set tg_errors=None as explicit method parameter helps -
I _think_ it should be part of the signature, but ATM that's just a guess.

Diez


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Lewis  
View profile
 More options Nov 23 2007, 11:54 am
From: Patrick Lewis <patrickhle...@gmail.com>
Date: Fri, 23 Nov 2007 08:54:36 -0800 (PST)
Local: Fri, Nov 23 2007 11:54 am
Subject: Re: CompoundFormField widget and validation
On Nov 23, 11:19 am, "Diez B. Roggisch" <de...@web.de> wrote:

I just tried that, and it doesn't seem to make a difference.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glauco  
View profile
 More options Nov 27 2007, 4:16 am
From: Glauco <gla...@sferacarta.com>
Date: Tue, 27 Nov 2007 10:16:54 +0100
Local: Tues, Nov 27 2007 4:16 am
Subject: Re: [TurboGears] CompoundFormField widget and validation
Patrick Lewis ha scritto:

why you do this with a compound?  is only an example i hope.

i cannot see the error.
any way if i'm not wrong the problem is validation system,
i'm not sure the CompoundWidget can use validation in this manner...

Glauco

--
+------------------------------------------------------------+
 Glauco Uri  
 glauco(at)sferacarta.com

          Sfera Carta SoftwareŽ       info(at)sferacarta.com
  Via Bazzanese,69  Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Lewis  
View profile
 More options Nov 27 2007, 9:58 am
From: Patrick Lewis <patrickhle...@gmail.com>
Date: Tue, 27 Nov 2007 06:58:21 -0800 (PST)
Local: Tues, Nov 27 2007 9:58 am
Subject: Re: CompoundFormField widget and validation

On Nov 27, 4:16 am, Glauco <gla...@sferacarta.com> wrote:

It's an example, but it relates to a real problem that we are seeing
in TGCaptcha.  TGCaptcha does essentially the same thing, but with a
bit more complicated CompoundFormField and Schema. However, the error/
behavior is similar to what is in the example.  If someone crafts an
url or form without the entire captcha field, then validation seems to
skip the widget, and passes it on to the destination controller as if
the captcha was successful.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile
 More options Nov 27 2007, 10:10 am
From: "Diez B. Roggisch" <de...@web.de>
Date: Tue, 27 Nov 2007 16:10:31 +0100
Local: Tues, Nov 27 2007 10:10 am
Subject: Re: [TurboGears] Re: CompoundFormField widget and validation
On Tuesday 27 November 2007 15:58:21 Patrick Lewis wrote:

Looks like a bug then - can you file a ticket? The coolest thing would be a
short demo-app that exposes the desired behavior, by e.g. having two or three
links in the welcome-template that one could test. Or - even better - tests
in the project, I would then try and see if I can rework them into the core
tests.

Diez


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Lewis  
View profile
 More options Nov 28 2007, 2:51 am
From: Patrick Lewis <patrickhle...@gmail.com>
Date: Tue, 27 Nov 2007 23:51:26 -0800 (PST)
Local: Wed, Nov 28 2007 2:51 am
Subject: Re: CompoundFormField widget and validation
On Nov 27, 10:10 am, "Diez B. Roggisch" <de...@web.de> wrote:

In putting together some tests, I ran into something interesting
(well, for me anyways). If I explicitly name the widget in the method
parameters, everything works as expected. So, if I change my example
save controller to:

def save(self, mywidget={}, **kw):
    return dict(kw=kw, controller='save')

then everything is just fine.

I guess I don't know what the proper/expected behavior should be. Is
this still a bug?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile
 More options Nov 29 2007, 4:15 am
From: "Diez B. Roggisch" <de...@web.de>
Date: Thu, 29 Nov 2007 10:15:08 +0100
Local: Thurs, Nov 29 2007 4:15 am
Subject: Re: [TurboGears] Re: CompoundFormField widget and validation
Patrick Lewis schrieb:

I'd say so, yes - because when for whatever reason there need to be
properly named parameters, there should at least warnings if not more in
case you don't supply them.

Diez


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Lewis  
View profile
 More options Nov 29 2007, 6:15 am
From: Patrick Lewis <patrickhle...@gmail.com>
Date: Thu, 29 Nov 2007 03:15:21 -0800 (PST)
Local: Thurs, Nov 29 2007 6:15 am
Subject: Re: CompoundFormField widget and validation
On Nov 29, 4:15 am, "Diez B. Roggisch" <de...@web.de> wrote:

> Patrick Lewis schrieb:
> > I guess I don't know what the proper/expected behavior should be. Is
> > this still a bug?

> I'd say so, yes - because when for whatever reason there need to be
> properly named parameters, there should at least warnings if not more in
> case you don't supply them.

> Diez

Ok, ticket filed.
http://trac.turbogears.org/ticket/1621

Thanks.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google