On Thu, Jul 21, 2016 at 3:29 PM, Mehdi gmira <[email protected]> wrote:
> Is there a way to explicitely add objects to the identity map ? I would like
> to be able to do something like:
>
> foos = session.query(Foo).all()
> add_to_identity_map(foos)

I don't understand the question - objects loaded by session.query are
*already* in the identity map for that session.

If you have an object that wasn't loaded from the session originally,
I think the official answer is session.merge(), although that returns
a new object. Would that work in your instance?

Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to