Reputation: 3355
I was wondering if it was possible to somehow fetch the objects from a table and get them returned indexed by an arbitrary value, similar to mapped_collection.
I realize that this is easy to work around (And that I am already doing). But I was just wondering if this was possible.
Upvotes: 0
Views: 79
Reputation: 75137
what's wrong with :
my_mapping = dict(Session.query(MyClass.somekey, MyClass))
?
I do that all the time to make a quick cache of something.
Upvotes: 1