Joe wrote:
> This appears to work and I'm able to edit a wiki page and it appears to
> save it, but it doesn't really.  The problem is that in page.py, the
> __before__() and delete() methods use objecstore.

Are you explicitly saving [1] newly created objects (such as your wiki
page) to the SQLAlchemy session where needed? The threadlocal plugin
[2] will automagically do this for you, so if you remove it, you have
to do it manually or flush'ing a session wil do nothing.

> SA has an object_session() function that can be used to obtain the
> session for an object, but I'm not sure what object to use.

You might want to read SQLAlchemy's documentation on sessions [3]. This
should get you started.

Here is a small, exemplary snippet of code to show you how to create
and save objects without threadlocal magic in SQLAlchemy:

---------------------- snipp -------------------
page = WikiPage(name='PylonsForRunaways')
session.save(page) # save page to session
session.flush() # write session changes to the database
---------------------- snipp -------------------

Hope that helps,
Michael

[1] http://www.sqlalchemy.org/docs/unitofwork.myt#unitofwork_api_save
[2] http://www.sqlalchemy.org/docs/plugins.myt#plugins_threadlocal
[3] http://www.sqlalchemy.org/docs/unitofwork.myt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to