Re: [sqlalchemy] Determining what, if anything, a Session.merge() does?

2016-03-10 Thread Russ
Excellent, thank you. is_modified() works very well in this case, with caveats noted. Also, a nice intro to the History API... hadn't seen that before! -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop

Re: [sqlalchemy] Error dropping table with sequence on Postgres

2016-03-10 Thread Mike Bayer
On 03/10/2016 09:52 PM, Jay Camp wrote: Postgres: 9.4 SQLAlchemy: 1.0.11 When a sequence is created against a column, calling `metadata.drop_all()` tries to drop the sequence before dropping the table and fails because the table is still referencing the sequence. Manually dropping the table

[sqlalchemy] Error dropping table with sequence on Postgres

2016-03-10 Thread Jay Camp
Postgres: 9.4 SQLAlchemy: 1.0.11 When a sequence is created against a column, calling `metadata.drop_all()` tries to drop the sequence before dropping the table and fails because the table is still referencing the sequence. Manually dropping the table then dropping the sequence works. The

Re: [sqlalchemy] Determining what, if anything, a Session.merge() does?

2016-03-10 Thread Mike Bayer
On 03/10/2016 08:06 PM, Russ wrote: Is there any way to tell what the outcome of a Session.merge() operation is? The case of specific interest is when the instance to be merged *does* exist prior to the merge() call. Is there a built in way to see if any attributes end up updated, or does

[sqlalchemy] Determining what, if anything, a Session.merge() does?

2016-03-10 Thread Russ
Is there any way to tell what the outcome of a Session.merge() operation is? The case of specific interest is when the instance to be merged *does* exist prior to the merge() call. Is there a built in way to see if any attributes end up updated, or does this need to be checked manually? --

Re: [sqlalchemy] how to handle SQLite's GUID?

2016-03-10 Thread c.buhtz
Ok, sorry. I used unconcrete words. I don't want to create something like that. I want to know which one of the standard SQLAlchemy-offered data types would be the best fitting to handle (just read and use for UPDATE) a vendor-column-type like that. -- You received this message because you are

[sqlalchemy] Re: Ways of processing multiple rows with same ID?

2016-03-10 Thread Jonathan Vanasco
What might work for you (if the database is structured as such) would be something like this (in pseudocode) class ProductAttribute(base): id = column-int, primary key name = column-unicode class Product2ProductAttribute(base): product_id =column-int, part of

Re: [sqlalchemy] Re: Ways of processing multiple rows with same ID?

2016-03-10 Thread Alex Hall
What I'm doing, and sorry for not explaining further, is making a CSV file of data. Each row is a row in my results, or would be if I were just selecting from products. Having to select from attributes as well is where I'm having problems. Each product can have multiple attributes, and each

[sqlalchemy] Re: Ways of processing multiple rows with same ID?

2016-03-10 Thread Jonathan Vanasco
2 comments: 1. Go through the SqlAlchemy ORM tutorial. What you're describing right now is dancing around some very basic relationship definition and loading/query techniques. 2. You haven't described what you actually want to accomplish, only some general ideas of how you think you could

[sqlalchemy] Ways of processing multiple rows with same ID?

2016-03-10 Thread Alex Hall
Hi list, I'm not sure how to explain this, so let me know if I lose you. I have the same products database as yesterday, but I've just learned that product attributes are stored in their own tables. A product can have many attributes (size, color, weight, etc), and each attribute value is in a