Quantcast
Channel: SQLAlchemy get items from the identity map not only by primary key - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Krangerich for SQLAlchemy get items from the identity map not only...

It's possible to access the whole identity map sequentially:for obj in session.identity_map.values(): print(obj)To get an object by arbitrary attributes, you then have to filter for the object type...

View Article



Answer by Nabeel Ahmed for SQLAlchemy get items from the identity map not...

A brief overview of identity_map and get():An identity map is kept for a lifecycle of a SQLAlchemy's session object i.e. in case of a web-service or a RESTful api the session object's lifecycle is not...

View Article

SQLAlchemy get items from the identity map not only by primary key

Is it possible to use a couple of fields not from the primary key to retrieve items (already fetched earlier) from the identity map? For example, I often query a table by (external_id, platform_id)...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images