Folks, I'm moving from Turbogears to Pylons and I need help
understanding the following.  Right now, when I create a session by
doing the following:

session = create_session()

And then create some objects below as :  Page(...), I find that after
doing a session.flush(), nothing happens.  I don't see any commits to
the db unless I do something like p = Page() and then p.flush().
Basically, my session is not associated with anything.  In turbogears,
the session was given to us and we passed it into the mapper as
assign_mapper(session.context, ....), but here, we're importing
something else called session_context and passing that in.  How can I
associate my session with the mapper so that a session.flush() takes
effect.

In pylons:
class Page(object):
    def __str__(self):
        return self.title

page_mapper = assign_mapper(ctx, Page, pages_table)

In tg:
page_mapper = assign_mapper(session.context, Page, pages_table)

Thanks in advance,

Sam


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to