[Grok-dev] Saving multiple objects from one AddForm

Darryl Cousins 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:
> http://kirbi.googlecode.com/svn/trunk/src/kirbi/pac.py

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.

HTH, regards,

> 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:
> http://kirbi.googlecode.com/svn/trunk/src/kirbi/demo/collection.py
> 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?
> Cheers,
> Luciano
> 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
> http://mail.zope.org/mailman/listinfo/grok-dev

More information about the Grok-dev mailing list