Oops. That should be:
class AddItForm(TableForm):
class fields(WidgetsList):
refrerence_ops = []
for record in DBSession.query(model.Reference):
reference_ops.append((record.id, record.name))
reference = SingleSelectField(options=reference_ops)
On Aug 28, 1:53 pm, Sean DiZazzo <[email protected]> wrote:
> Hi,
>
> I am creating a form and populating a SingleSelectField based on the
> contents of another field from the database. However, if I create a
> new record in the referenced field, the SingleSelectField doesn't see
> it because it has already been populated.
>
> Here's how I'm initializing the form:
>
> class AddItForm(TableForm):
> class fields(WidgetsList):
> refrerence_ops = []
> for record in DBSession.query(model.Reference):
> reference_ops.append((record.id, record.name))
> reference = SingleSelectField(options=reference_ops)
>
> Whats the right way to populate the SingleSelect so it stays up to
> date?
>
> I tried passing kwargs around and doing the query in the form itself,
> but I think it needs to happen in the template somehow. But I don't
> see it.
>
> ~Sean
--
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.