Questions tagged as 'sqlalchemy'

1
answer

Query database with SQLAlchemy

I am trying to apply a query to a table, using the ORM sqlalchemy in a database already created with mysql, with the following code: eng = create_engine("mysql+mysqldb://host='localhost', user='root', passwd='...',port='3307', database='Nomina...
asked by 08.08.2017 / 01:00
1
answer

The database does not want to connect to the host

I'm trying to connect to my MySQL database, I do not want to recognize the localhost, it bounces in error: from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker eng = create_engine("mysql+mysqldb:///host='localhost...
asked by 13.08.2017 / 22:13
1
answer

How to date format a field obtained from the database?

I get a field from the string type database field = 20180117 I'm trying to do something similar to this datetime.strptime(campo, '%Y-%m-%d').strftime('%Y-%m-%d-T%H:%M:%S') 2018-01-17-T00:00:00 Any ideas or sug...
asked by 17.01.2018 / 21:38
1
answer

I need to dynamically pass to the "query" object of SQLAlchemy the parameters of the class next to its attributes

I need to dynamically arm the part where the .query() gets the class of the objects and their attributes, that is, that within query dynamically insert the tables and columns received from another application. For example: sessio...
asked by 19.09.2016 / 17:17
1
answer

Join in sqlalchemy

I am trying to pass a query that I have made - and I already tried it in SQL - to SQLAlchemy in python using Flask. This is the query in SQL: select Reclamo.IdReclamo from Reclamo,ServicioAsignacion,ReclamoServicioAsignacionAfectado where S...
asked by 23.09.2016 / 17:00
1
answer

Unable to call the "list" object when using Session.add_all [closed]

I am inconvenienced with this code generates me error:    id_ccf = input ("Type the name of the CCF"))])   TypeError: 'list' object is not callable I do not understand why, I do not have any object named 'list'. This is the relevant part...
asked by 14.12.2017 / 01:45
2
answers

Alchemy Flask error in Python

I've been doing the tutorial link to learn Python but I have not managed to get the import to sqlalchemy generating the following error:    $ python app.py Traceback (most recent call last): File "app.py", line   2, in from flask_sqlalchemy...
asked by 06.03.2017 / 19:38
0
answers

capture warning messages postgresql from python - sqlalchemy

Please can someone guide me as I can capture the personalized WARNING-level messages created in POSTGRES, I explain. I have currently created a function that returns general box information, there is a calculated field in which if this is les...
asked by 11.08.2017 / 05:38
1
answer

TypeError: 'NoneType' object is not iterable in python with sqlalchemy

I write because I can not solve a problem with a query made by my API that is made in Python. This same error does not affect the functioning of the API but I want to remove it anyway because it looks sloppy or clearly not programmed with SQLAlc...
asked by 07.12.2016 / 14:35
3
answers

Error accessing SQLAlchemy and mysql database

I have installed an Ubuntu server! 6.04.4 LTS, mysql 5.7.21 and python 3.5.2. I am developing a script in python that gives me the information of the existing databases. The problem is that executing the script always gives me this error:   ...
asked by 08.04.2018 / 23:09