[Grok-dev] Saving multiple objects from one AddForm
darryl at darrylcousins.net.nz
Thu Jun 28 22:50:57 EDT 2007
On Thu, 2007-06-28 at 23:24 -0300, Luciano Ramalho wrote:
> Maybe I'm tired and missing something, but I've not been able to hack
> a simple way to load test data into the ZODB...
> The relevant code is here:
After a quick look I notice first that you have missed form_fields for
the DemoBooks add form, which would explain why the fields are empty.
> The AddBook AddForm works as expected.
> Then I tried to do a quick hack in the form of the DemoBooks AddForm,
> which basically presents one button and when submitted loads a list of
> dictionaries from this other module containing 289 book records:
> For some reason, the DemoBooks.add method creates 289 book instances,
> with names derived from the isbn13 field, but with all fields empty...
> as if the line:
> self.applyData(book, **dic)
> ...had no effect.
> What am I missing?
> PS. I will import all my grok code to the official Zope SVN; I just
> have not had time to learn how to do a buildout to make proper
> checkins of Kirbi and my other sample apps... next week school will be
> over and my pace will pick up.
> Grok-dev mailing list
> Grok-dev at zope.org
More information about the Grok-dev