So I'm mistaken about the purpose of the rootFolder method then.
However, I can't really use the IDataOpenedWithRootEvent cleanly because
I don't want the root obj when the connection is opened, I want it
later. Therefore, getting at the root obj still isn't real obvious to me
in this situation.<br><br><div class="gmail_quote">On Wed, Jun 30, 2010 at 4:06 PM, Christophe Combelles <span dir="ltr"><<a href="mailto:ccomb@free.fr">ccomb@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Le 30/06/2010 21:47, Jim Pharis a écrit :<br>
<div class="im">> No, I don't see the changes. Maybe I should be more specific about what<br>
> I'm doing.<br>
><br>
> I have an AdminUtility registered with the below method that I call from<br>
> a view. If I inspect the root object after that method exists newsite<br>
> isn't in there.<br>
><br>
> from zope.site.folder import rootFolder<br>
> def install(self)<br>
> newsite = NewSite()<br>
> newsite.setSiteManager(LocalSiteManager(newsite))<br>
> root = rootFolder()<br>
> import pdb; pdb.set_trace()<br>
> root['newsite'] = newsite<br>
> root._p_changed = True<br>
> transaction.commit()<br>
<br>
<br>
</div>You're creating a root object in a local variable, and this variable is<br>
destroyed at the end of the function. You should retrieve the root instead of<br>
creating it, since an empty ZODB always has a root object.<br>
<br>
<a href="http://bluebream.zope.org/doc/1.0/faq.html#how-do-i-automatically-create-some-needed-object-at-application-startup" target="_blank">http://bluebream.zope.org/doc/1.0/faq.html#how-do-i-automatically-create-some-needed-object-at-application-startup</a><br>
<div class="im"><br>
><br>
><br>
> On Wed, Jun 30, 2010 at 3:11 PM, Christophe Combelles <<a href="mailto:ccomb@free.fr">ccomb@free.fr</a><br>
</div><div><div></div><div class="h5">> <mailto:<a href="mailto:ccomb@free.fr">ccomb@free.fr</a>>> wrote:<br>
><br>
> Le 30/06/2010 20:31, Jim Pharis a écrit :<br>
> > I'm trying out BlueBream 1.0b2 and I'm running into a problem with<br>
> > Persistent objects. The installation is pretty out of the box at this<br>
> > point. When I use .\bin\paster shell debug.ini I seem to be able to<br>
> > create Persistent objects and transaction.commit and changed<br>
> objects are<br>
> > properly committed. However, when I start using either .\bin\paster<br>
> > serve debug.ini or .\bin\paster serve deploy.ini, no matter what<br>
> I do to<br>
> > Persistent objects transaction.commit() returns None. I noticed that<br>
> > even if I directly set obj._p_changed=1 it doesn't work, and if I<br>
> look<br>
> > at _p_changed right away, I see its been reverted back to False.<br>
> What am<br>
> > I doing wrong here?<br>
><br>
> Hi!<br>
><br>
> transaction.commit() is not supposed to return anything, don't you<br>
> see the<br>
> changes in your application after ending the debug session and<br>
> returning to the<br>
> paster serve ?<br>
><br>
> Christophe<br>
><br>
> ><br>
> > TIA,<br>
> ><br>
> > - Jim<br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > bluebream mailing list<br>
</div></div>> > <a href="mailto:bluebream@zope.org">bluebream@zope.org</a> <mailto:<a href="mailto:bluebream@zope.org">bluebream@zope.org</a>><br>
<div class="im">> > <a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
><br>
> _______________________________________________<br>
> bluebream mailing list<br>
</div>> <a href="mailto:bluebream@zope.org">bluebream@zope.org</a> <mailto:<a href="mailto:bluebream@zope.org">bluebream@zope.org</a>><br>
<div><div></div><div class="h5">> <a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
><br>
><br>
<br>
_______________________________________________<br>
bluebream mailing list<br>
<a href="mailto:bluebream@zope.org">bluebream@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
</div></div></blockquote></div><br>