Hi,

Based on the code in twForms ... samples.py, I'm trying to do the same
basic idea with a Person object which has multiple Address objects.

The address fields all appear but are not populated, even though the
name of the repeater matches the addresses attribute on Person (which
is a list of Address objects). The other fields from the Person object
are populated with the data of the Person passed in to display() (so
it half works).

class AddressFieldset(ListFieldSet):
    class fields(WidgetsList):
        kind = RadioButtonList(options=['Home','Work','Other'],
default='',
                validator=UnicodeString(not_empty=True),
css_class='radiobuttonlist compactw')
        address = TextArea(validator=UnicodeString, rows=2, cols=35)
        city = TextField(default='Chicago')
        state = TextField(default='IL',validator=StateProvince)
        postal_code = TextField(validator=PostalCode)


class PersonForm(ListForm):
    class fields(WidgetsList):
        id = HiddenField(validator=Int, default=0)
        name_first = TextField(label_text="First",
validator=UnicodeString(not_empty=True))
        name_last = TextField(label_text='Last',
validator=UnicodeString(not_empty=True))
        addresses = FormFieldRepeater(
            widget=AddressFieldset(), repetitions=1)

Any idea what detail I'm missing?

--i


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to