Re: [sqlalchemy] "How to do a revision table" or "How to get a 1:1 and 1:n relationship between the same tables to work properly"

2015-06-17 Thread Mike Bayer
On 6/17/15 12:00 PM, Adrian wrote: I'm trying to store old versions of (some of) the data in one of my tables. To do so, I'm thinking about models like this (not including anything not relevant to the case): class EventNote(db.Model): id = db.Column(db.Integer, primary_key=True) late

Re: [sqlalchemy] Append AND NULL condition on joins

2015-06-17 Thread Mike Bayer
On 6/17/15 12:12 PM, david.ceresu...@gmail.com wrote: Hi all, I was giving SQLAlchemy 1.0 series a try but I have found some problems along the way. There are some queries that in the 0.9.9 version used to work, but they do not work as expected anymore. An example of one of those is: | fee

[sqlalchemy] Append AND NULL condition on joins

2015-06-17 Thread david . ceresuela
Hi all, I was giving SQLAlchemy 1.0 series a try but I have found some problems along the way. There are some queries that in the 0.9.9 version used to work, but they do not work as expected anymore. An example of one of those is: feeds = DBSession.query(Feed, Client, ClientPro).outerjoin( C

[sqlalchemy] "How to do a revision table" or "How to get a 1:1 and 1:n relationship between the same tables to work properly"

2015-06-17 Thread Adrian
I'm trying to store old versions of (some of) the data in one of my tables. To do so, I'm thinking about models like this (not including anything not relevant to the case): class EventNote(db.Model): id = db.Column(db.Integer, primary_key=True) latest_revision = db.relationship( '

Re: [sqlalchemy] Concurrent use of `bulk_insert_mappings` and `bulk_update_mappings`

2015-06-17 Thread Mike Bayer
On 6/17/15 4:05 AM, Soeren Medard wrote: Hi, I have had an issue with bulk operations arising from the following use case: I was looping an iterator of mappings, which are either already in the DB (inserts) or not (updates). As I did not want to loop over it twice and wanted to do only on tr

[sqlalchemy] Concurrent use of `bulk_insert_mappings` and `bulk_update_mappings`

2015-06-17 Thread Soeren Medard
Hi, I have had an issue with bulk operations arising from the following use case: I was looping an iterator of mappings, which are either already in the DB (inserts) or not (updates). As I did not want to loop over it twice and wanted to do only on transaction, I used greenlets do split the iter