On 11/2/05, Tim Lesher <[EMAIL PROTECTED]> wrote:
> > Widgets
>
> From what I can tell, TG's widgets sound like more ubiquitous versions
> of Spyce's Active Tags. Is that the case?  What are some of the
> differences?
>
> Active Tags are the only thing I really miss from Spyce (other than
> errors in .py files not bringing down the server... but more on that
> another time).

Ahh, more prior art to check out. It's been a while since I looked at
Spyce. If memory serves, active tags are kind of like JSP tags. I
should take a closer look though to make sure I'm not missing
something interesting.

> > A TableForm displays a label for each field in one column of a table,
> > with the field controls in another column of the table. A TableForm
> > gives you a submit button for free.
>
> ...but it doesn't force you to use its submit button, right? Right?

What? You want a different kind of submit button? That's asking a bit
much, isn't it? :)

You can customize the submit button text with a parameter to the form,
and you can also give it a different widget to use for the submit
button.

> > Also, since the form knows what the
> > submit button was called, it is automatically thrown out. (Someone's
> > probably going to say "hey! I need that submit button value!"...
> > widgets are customizable through standard Python means. Subclass and
> > override. Piece of cake.)
>
> Thanks. :-)
>
>
> > The form will be redisplayed with good values prepopulated and the
> > invalid ones thrown out. An error message would be displayed next to
> > the "age" field on the form. And we all heave a sigh of relief that we
> > didn't have to do that in validation_error :)
>
> Not bad so far... what is has_errors (other than something that
> doesn't evaluate to boolean false)? It would be convenient to have it
> be a dict of keys_with_errors:bad_value, and then your 'if' would
> still work.

Right now, it's just a boolean. You can get the keys with errors by
grabbing cherrypy.request.form_errors.keys()

I'm going to guess that most uses of has_errors will just be to punt
to another method.

Kevin

Reply via email to