Web programming and a different "type" problem
ianb at colorstudy.com
Wed Apr 30 05:31:32 CEST 2003
On Tue, 2003-04-29 at 19:12, Dave Cole wrote:
> So what Albatross does is allow (require) you to specify when a field
> should return a list. If you build a form which contains multiple
> inputs with the same name ("radio" is an obvious exception) then it
> will raise an exception if you do not use the "list" attribute on all
> of the instances of the field in the form.
How do you specify that you expect a list? Does it happen at runtime,
when you fetch the value from the request with an I'm-expecting-a-list
method? Or is there some more declarative schema involved?
> In our experience you can get subtle and annoying bugs in your
> application as a result of incorrect handling of fields which
> sometimes return multiple values.
Indeed, but I've usually found that the bugs were from form generation,
not from form processing. It might be better if the error is signaled
earlier and in a more pleasant way, but IMHO throwing away duplicate
values when they aren't expected just covers up bugs. But I don't think
that's what you're doing in this case (though it sounds like jonpy does
this, for instance)...?
> When the </al-form> tag is processed, the record of fields is encoded
> into a hidden field called __albform__. The field value is MD5 signed
> by combining the encoded value with a server side secret and the sign
> is combined with the __albform__ value.
Again out of curiosity -- what exactly goes into the __albform__ value?
I.e., what information are you saving there?
More information about the Python-list