[sqlalchemy] Re: join relationship

2018-02-01 Thread Jonathan Vanasco
at the very least, you are not using a "join" on the tables. i suggest first going through the tutorial again, and paying attention to the section on "join". http://docs.sqlalchemy.org/en/latest/core/tutorial.html#using-joins -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapp

Re: [sqlalchemy] adding entirely custom constraints

2018-02-01 Thread Chris Withers
awesome, thanks! On 01/02/2018 15:50, Mike Bayer wrote: On Thu, Feb 1, 2018 at 3:27 AM, Chris Withers wrote: Hi, So, I need to add an exclude constraint to a postgres table which has a boolean column, but: ProgrammingError: (psycopg2.ProgrammingError) data type boolean has no default operato

Re: [sqlalchemy] adding entirely custom constraints

2018-02-01 Thread Mike Bayer
On Thu, Feb 1, 2018 at 3:27 AM, Chris Withers wrote: > Hi, > > So, I need to add an exclude constraint to a postgres table which has a > boolean column, but: > > ProgrammingError: (psycopg2.ProgrammingError) data type boolean has no > default operator class for access method "gist" > HINT: You mu

Re: [sqlalchemy] Handling unicode characters with SQLalchemy 1.1.13 and python 2.7

2018-02-01 Thread Mike Bayer
This has to do with the driver also. What driver and OS are you using? FreeTDS has to be configured in the conf settings. On Feb 1, 2018 12:50 AM, "Nikhil kumar" wrote: > Hi, > I am using a unicode character in my python string i.e. \u2013. When I try > to insert this into mssql I see this cha

[sqlalchemy] Convert MySQL query into SQLAlchemy (python) Expression

2018-02-01 Thread Nemanja Mihajlovic
Hi, I have a problem to convert the following MySQL query into SQLAlchemy (python) expression: SELECT SUM(IF(t1.column_3 = 1 AND t1.column_4 > DATE_SUB(NOW(), INTERVAL 2 MONTH), 1, 0)) AS label_1, SUM(IF(t1.column_3 = 1 AND t1.column_4 > DATE_SUB(

Re: [sqlalchemy] Implementing historical tables

2018-02-01 Thread Simon King
On Wed, Jan 31, 2018 at 5:27 PM, Stanislav Lobanov wrote: > Hello, i need to create a system, that can store historical versions of > objects. > > Example model looks like: > > class User(Base): >id=Column(Integer) # ForeignKey >start=Column(DateTime) >end=Column(DateTime) >name=C

[sqlalchemy] adding entirely custom constraints

2018-02-01 Thread Chris Withers
Hi, So, I need to add an exclude constraint to a postgres table which has a boolean column, but: ProgrammingError: (psycopg2.ProgrammingError) data type boolean has no default operator class for access method "gist" HINT:  You must specify an operator class for the index or define a default