Felix Schwarz wrote:
> How can I do that (tell Elixir not to use the global session but
> one that I provide at entity creation time)?
One way is to use the `using_options` statement on the relevant
entities. The documentation is found here:
http://elixir.ematia.de/apidocs/elixir.options.html
It states:
"Specify a custom contextual session for this entity. By
default, entities uses the global elixir.session. This option
accepts Objectstore (found in Elixir and ActiveMapper),
SessionContext (found in SQLAlchemy 0.3) or ScopedSession (found
in SQLAlchemy 0.4) objects. It also supports None, in which case
your entity will be mapped using a non-contextual mapper. This
option can also be set for all entities of a module via by
setting the __session__ attribute of that module"
So, in addition to the `using_options` method, you can also set a
module-level `__session__` attribute, or even monkeypatch elixir by
overwriting `elixir.session` with your own session.
--
Jonathan LaCour
http://cleverdevil.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---