I use a SingleSelectField Widget for a one to many relationship of an address
book application. Within this application it is possible to select one of
many titles for a person.
All CRUD operations of the application are working correct but the title
select field doesn't select the item that it should. You can write title
data to the model but not view.
The first title element is always selected when you view a person's data.
Has someone an idea to solve this?
My controller defines Fields, Schema and the the Forms in that way:
class PersonFields(widgets.WidgetsList):
titles= Title.select()
titlelist=[]
for t in titles:
titlelist.append((t.id,t.title))
title = widgets.SingleSelectField(label="Titel",options=titlelist)
person_first = widgets.TextField(label="Vorname")
person_last = widgets.TextField(label="Nachname")
email_1 = widgets.TextField(label="Email1")
class PersonSchema(validators.Schema):
person_first = validators.String(not_empty=True, max=40)
person_last = validators.String(not_empty=True, max=40)
email_1 = validators.Email()
class PersonForm(widgets.TableForm):
fields = PersonFields()
validator = PersonSchema()
model_form = PersonForm()
--
View this message in context:
http://www.nabble.com/SingleSelectField-tp14965999p14965999.html
Sent from the Turbogears General mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---