[sqlalchemy] checking if some object with the given id is in a session

2011-09-19 Thread Eduardo
Hi, I create a certain number of objects in a loop, I check if each of the objects is already stored in the session and if it is not I add it to the session. session = Session() for item in items: item1=create_item() if not item1 in session: session.add(item1) session.commit() The

[sqlalchemy] selecting an amibiguous column, but not caring from which table

2011-09-19 Thread Moshe C.
Hi, I have the following situation: There are two tables, A and B , both of which have an id column. In a certain part of the code I have an ORM query object. That query object is returned by some function and I have no apriori knowledge of its structure. I am assured, though that there will be

Re: [sqlalchemy] selecting an amibiguous column, but not caring from which table

2011-09-19 Thread Michael Bayer
On Sep 19, 2011, at 10:37 AM, Moshe C. wrote: Hi, I have the following situation: There are two tables, A and B , both of which have an id column. In a certain part of the code I have an ORM query object. That query object is returned by some function and I have no apriori knowledge of

[sqlalchemy] Versioning and Foreign Keys

2011-09-19 Thread JPLaverdure
Hello, I'm using the versioned objects suggested in the SQLAlchemy examples: http://www.sqlalchemy.org/docs/orm/examples.html#versioned-objects One of the aspects of entity management seems a bit weird though: If entities are linked using foreign keys, (let's say in one-to-many relationship),

[sqlalchemy] Re: Versioning and Foreign Keys

2011-09-19 Thread JPLaverdure
Oops, above references to versioned_meta should read history_meta. Sorry -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/0ZtFX94qz_wJ. To post to this group,

Re: [sqlalchemy] Versioning and Foreign Keys

2011-09-19 Thread Michael Bayer
On Sep 19, 2011, at 4:09 PM, JPLaverdure wrote: Hello, I'm using the versioned objects suggested in the SQLAlchemy examples: http://www.sqlalchemy.org/docs/orm/examples.html#versioned-objects One of the aspects of entity management seems a bit weird though: If entities are linked using

Re: [sqlalchemy] UNION in many-to-many relation

2011-09-19 Thread Michael Bayer
On Sep 19, 2011, at 12:45 PM, Vlad K. wrote: Hi! I have a model, let's call it Resource. And another, let's call it Container. Each container can have any number of Resources, so they're in many-to-many relationship. What's worse, they're in association object pattern relationship