But even better was to use tw.dynforms as described here: http://toscawidgets.org/documentation/tw.dynforms/tutorial.html
This gives me a form with a growing/shrinking list of subsamples that I need. I think that a worthwhile addition or change to the documentation would address the fact that the Movie Database advanced tutorial uses Sprox, and then when you begin to use the fancier Tosca Widgets, things stop working until you stop using sprox. At least that's my understanding at this point. This was a pretty confusing way to start off using Turbogears. Aside from that it's fantastic. On Aug 1, 4:31 pm, MHCPU <[email protected]> wrote: > Partly answering my own question... I'm still not sure about combining > FormFieldRepeater and sprox. But by simply following the example for a > ToscaWidgets > form:http://www.turbogears.org/2.1/docs/main/ToscaWidgets/forms.html > and using the example of a FormFieldRepeater in samples.py, I was able > to generate the form. I just had to add a bit of code to the method > that saves the data, to assemble a list of subsample model objects and > put them into the sample. > > On Aug 1, 10:56 am, MHCPU <[email protected]> wrote: > > > > > > > > > I have a simple model with two tables, call them "sample" and > > "subsample". Each sample has one or more subsamples (typically two to > > ten subsamples). I need to display a form with the fields for a > > sample, and up to ten sets of the subsample fields, and insert the > > sample and subsample data into the database when the form is > > submitted. > > > It looks like tw.forms.FormFieldRepeater would handle generating > > subsample section of the form. But I' not sure if FormFieldRepeater is > > compatible with using sprox. According to the example in tw/forms/ > > samples.py, the form that uses FormFieldRepeater needs to be > > subclassed from ListForm, and must contain a "fields" class... > > > class SampleForm(ListForm): > > class fields(WidgetsList): > > ... > > subsample = FormFieldRepeater( > > widget = SubsampleFieldset(), > > ... > > > whereas to use the form with sprox, the form needs to be subclassed > > from AddRecordForm, and not contain a fields class... > > > class SampleForm(AddRecordForm): > > subsample = ??? > > > Can I use FormFieldRepeater and sprox together? If not, any guidance > > on generating repeated sets of fields would be appreciated. -- 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.

