[sqlalchemy] Problems with sqlalchemy and timestamps

2017-03-06 Thread karl . lattimer
Hi, I'm having some trouble with sqlalchemy and timestamps I have a schema which looks like this class MyTable(Entity): __tablename__ = "MyTable" id = Column(Integer, primary_key=True) tstamp = Column(DateTime, nullable=False) when I run a query such as current_time =

Re: [sqlalchemy] Problems with sqlalchemy and timestamps

2017-03-06 Thread mike bayer
a ROLLBACK is occurring which suggests a different error has occurred and is being swallowed - the transaction can then not continue. Does your production environment have logs which would illustrate other exceptions and reasons for rollbacks prior to this one? It is possible that

Re: [sqlalchemy] Problems with sqlalchemy and timestamps

2017-03-06 Thread Jonathan Vanasco
On Monday, March 6, 2017 at 10:21:37 AM UTC-5, Mike Bayer wrote: > > a ROLLBACK is occurring which suggests a different error has occurred > and is being swallowed - the transaction can then not continue. Does > your production environment have logs which would illustrate other >

Re: [sqlalchemy] Select the hybrid method result on the query

2017-03-06 Thread mike bayer
On 03/06/2017 04:16 PM, Leonardo Mata wrote: Hello, My applications does some ordering using the distance from latitude and longitude haversine distance, i was able to calculate this using @hybrid.method and @.*expression, but i can't output the calculated distance: /class

[sqlalchemy] Select the hybrid method result on the query

2017-03-06 Thread Leonardo Mata
Hello, My applications does some ordering using the distance from latitude and longitude haversine distance, i was able to calculate this using @hybrid.method and @.*expression, but i can't output the calculated distance: *class PartnerAddress(db.Model, WithTimestampsModel, SerializeMixin):*

Re: [sqlalchemy] Select the hybrid method result on the query

2017-03-06 Thread Leonardo L. P. da Mata
Hello, thanks for the help. This makes sense but it looks like that the value is calculated twice, one in the query and the other accessing the property. My idea is to have the result on the query return itself. 2017-03-06 18:31 GMT-03:00 mike bayer : > > > On

Re: [sqlalchemy] Select the hybrid method result on the query

2017-03-06 Thread Leonardo L. P. da Mata
Thanks mike, that was a helpful explanation. 2017-03-06 18:59 GMT-03:00 mike bayer : > > > On 03/06/2017 04:47 PM, Leonardo L. P. da Mata wrote: > >> Hello, thanks for the help. >> >> This makes sense but it looks like that the value is calculated twice, >> one in the

Re: [sqlalchemy] Select the hybrid method result on the query

2017-03-06 Thread mike bayer
On 03/06/2017 04:47 PM, Leonardo L. P. da Mata wrote: Hello, thanks for the help. This makes sense but it looks like that the value is calculated twice, one in the query and the other accessing the property. My idea is to have the result on the query return itself. "lat" and "lng" here

[sqlalchemy] Alembic or SQLAlchemy-Migrate

2017-03-06 Thread John Robson
For Migrations (in PostgreSQL), what you guys recommend? Alembic or SQLAlchemy-Migrate ? Thank you. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See

Re: [sqlalchemy] Alembic or SQLAlchemy-Migrate

2017-03-06 Thread mike bayer
sqlalchemy-migrate is legacy at this point, I'd say it's "unmaintained" but that's only because I've been made the "maintainer" by some kind of default (becausenobody else was maintaining it. you get the idea). so yes alembic is the standard now. On 03/06/2017 07:15 PM, John Robson

Re: [sqlalchemy] Perfoming join on multiple tables dynamically

2017-03-06 Thread Simon King
On Mon, Mar 6, 2017 at 1:28 AM, Vijaya Sekar wrote: > Hello everyone, > > I have parent table which holds the primary keys of several child tables.The > child table are got as a list . Using SQLalchemy ORM, how can I join > multiple child tables to this parent? > Can