"Dan Jacob" <[EMAIL PROTECTED]> writes:

> BTW this is actually a separate issue. If the dict data_new misses any
> of the fields you get the same KeyError; it should be the case that any
> missing values are set to None or default.

This is why there's the 'data_new' dictionary to populate the second instance,
where I just want the dates to be empty in the CalendarDatePicker (that's
unfortunate that its default is the actual date instead of an empty field...).

> Another point: to set the values of "cidade", "estado" and "cep", you
> have to do this:
>
> dict_new = dict(
>     widget = dict(
>       cidade="Rio de Janeiro",
>       estado=None,
>       cep=None),...
>
> (Does cidade mean city ? My Portuguese is almost non-existent ;-))

(It does, CEP is our zip code, Estado means State)

> This is obviously inconvenient if you are passing in a SQLObject
> instance, for example, as you have to break it down for each field set.

Hmmm...  I didn't know that.  I'll fix my code. 

> Perhaps instead of a field set widget we could have a separate FieldSet
> class. For example:
>
> my_form = TableForm(
>       widgets = [TextField("name"),
>       TextField("country"),
>        TextField("postcode"),
>         TextField("street")],
>        fieldsets = [FieldSet("address"), widgets = ["country",
> "postcode", "street"]))
>
> The FieldSet class merely handles layout; it does not do any error or
> other form handling and is not a Widget subclass. It has an optional
> template parameter. You can pass in a widget list and optionally a
> fieldset list, if you want to have nested fieldsets. When the form is
> rendered it renders the fieldsets somehow in the correct order.

I would like to avoid FieldSet and use a list.  So when processing widgets in
a for each element would be on a row by itself while the list of elements
would put all of them on the same line. 

> This FieldSet class would allow you to create complex form layouts but
> keep the form handling simple.

The problem will be with the resulting HTML and alignment, I think...  But,
lets see what happens. ;-)

-- 
Jorge Godoy      <[EMAIL PROTECTED]>

Reply via email to