[sqlalchemy] Migrating from SQLAlchemy core to ORM

2016-06-15 Thread Arunabha Ghosh
Hi Folks, First of all, thanks for creating such a wonderful library. I've been using SQLAlchemy in my first serious Python project and it's the library I wish every language had ! Currently we only use SQLAlchemy core, so all the tables are defined using Table. Now, we would lik

[sqlalchemy] Applying joins sequentially to select objects

2016-06-15 Thread Kevin Murphy
Hi, Is it possible to repeatedly add column expressions to a select object, where the column expression involves outer joins? Ideally I'd like there to be a several transformation functions that operate on the same select object in a chain. So far, the closest I've come is for the transformati

Re: [sqlalchemy] LIKE operator and double percent signs

2016-06-15 Thread Jonathan Rogers
On 06/15/2016 01:37 PM, Mike Bayer wrote: > > > On 06/15/2016 01:34 PM, Mike Bayer wrote: >> >> >> On 06/15/2016 12:40 PM, Jonathan Rogers wrote: >>> On Friday, February 25, 2011 at 10:27:34 AM UTC-5, Michael Bayer wrote: >>> >>> >>> On Feb 25, 2011, at 10:20 AM, Jon Nelson wrote: >>> >>>

Re: [sqlalchemy] LIKE operator and double percent signs

2016-06-15 Thread Mike Bayer
On 06/15/2016 01:34 PM, Mike Bayer wrote: On 06/15/2016 12:40 PM, Jonathan Rogers wrote: On Friday, February 25, 2011 at 10:27:34 AM UTC-5, Michael Bayer wrote: On Feb 25, 2011, at 10:20 AM, Jon Nelson wrote: > On Fri, Feb 25, 2011 at 9:15 AM, Michael Bayer > wrote: >> % i

Re: [sqlalchemy] LIKE operator and double percent signs

2016-06-15 Thread Mike Bayer
On 06/15/2016 12:40 PM, Jonathan Rogers wrote: On Friday, February 25, 2011 at 10:27:34 AM UTC-5, Michael Bayer wrote: On Feb 25, 2011, at 10:20 AM, Jon Nelson wrote: > On Fri, Feb 25, 2011 at 9:15 AM, Michael Bayer > wrote: >> % is significant in DBAPIs like postgresql and m

Re: [sqlalchemy] LIKE operator and double percent signs

2016-06-15 Thread Jonathan Rogers
On Friday, February 25, 2011 at 10:27:34 AM UTC-5, Michael Bayer wrote: > > > On Feb 25, 2011, at 10:20 AM, Jon Nelson wrote: > > > On Fri, Feb 25, 2011 at 9:15 AM, Michael Bayer > wrote: > >> % is significant in DBAPIs like postgresql and mysqldb where pyformat > and format: %(foo)s and %s, are

[sqlalchemy] How to trigger Version Counters from another model update?

2016-06-15 Thread Jean-Philippe Morin
(I use PostgreSQL) For example, I have an application which retrieve a Sample. This Sample has many relationships to other models (One-to-One and One-to-Many) and everything is brought to the Web client. The user can add or edit any parts of any of those models. It can take a while before the

Re: [sqlalchemy] How to update a DateTime column with the SQL server value `NOW()`?

2016-06-15 Thread Jean-Philippe Morin
This is great! Thanks! On Wednesday, June 15, 2016 at 10:36:07 AM UTC-4, Mike Bayer wrote: > > > > On 06/15/2016 10:13 AM, Jean-Philippe Morin wrote: > > (I am using PostgreSQL) > > > > I want to use the TIMESTAMP values of the SQL server machine instead of > > the python `datetime.utcnow()` v

Re: [sqlalchemy] How to update a DateTime column with the SQL server value `NOW()`?

2016-06-15 Thread Mike Bayer
On 06/15/2016 10:13 AM, Jean-Philippe Morin wrote: (I am using PostgreSQL) I want to use the TIMESTAMP values of the SQL server machine instead of the python `datetime.utcnow()` value of the WEB server machines. There could be latencies or time diffierences between machines, so I would like t

[sqlalchemy] How to update a DateTime column with the SQL server value `NOW()`?

2016-06-15 Thread Jean-Philippe Morin
(I am using PostgreSQL) I want to use the TIMESTAMP values of the SQL server machine instead of the python `datetime.utcnow()` value of the WEB server machines. There could be latencies or time diffierences between machines, so I would like to use the database server date and time as a common

Re: [sqlalchemy] Joined/Eager loading into a non-relationship

2016-06-15 Thread Mike Bayer
On 06/15/2016 01:01 AM, Nick Whyte wrote: Hey, I'm working on a more complex problem with the ORM functionality of SQLA. I have a reasonably simple relationship, ie, class A(Base): id = sa.Column(sa.Integer(), primary_key=True) b_collection = sa.orm.relationship('B') class B(Base):