Most voted "sqlalchemy" questions
Use this tag When the question refers to some resource, information or problem related to Sqlalchemy, SQL object-relational mapping framework for Python programming.
Learn more…38 questions
Sort by count of
-
2
votes1
answer42
viewsHow can I timeout an attempt to connect to SQL Server using sqlalchemy?
I have a list of 200 hosts to connect. The problem is that when I try to connect to a host that is not available, it takes about 10 seconds for me to receive an exception telling me that I have not…
-
2
votes0
answers280
viewsFlask not creating Sqlite database via Slqalchemy
Good afternoon to all! No way my code is creating the database via SQL Alchemy, follow the code snippet. from flask_sqlalchemy import SQLAlchemy app = Flask(__name__)…
-
1
votes0
answers35
viewsSlugfy in FLASK query
I am trying to give a Slug in a given, I tried to use Lower and replace to swap some characters, my query is similar to this: return…
-
1
votes1
answer291
viewsInheritance in flask models
How do I set a class to inherit another class in flask models? I am creating the following User class in my models lass User(db.Model): __tablename__ = "users" id = db.Column(db.Integer,…
-
1
votes1
answer698
viewsPython Connect Sql With user and "token"
I have an application in Flask and am using Sqlalchemy to access SQL Server. I would like the connection to the database to be made by a generic user and the password is a "token", I thought it…
-
1
votes1
answer173
viewssum the database values and display the result in the flask-sqlalchemy template
have ma table with following information: class Registro(db.Model): id = db.Column(db.Integer, primary_key=True) valores = db.Column(db.Float) ------------| valores | ------------| 1.50 |…
-
1
votes2
answers220
viewsFlask Sqlalcheny Typeerror: 'Fermentables' Object is not iterable
In the model FermentableTypes: class FermentableTypes(db.Model): __tablename__ = "fermentable_types" id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(50)) desc =…
-
1
votes1
answer150
viewsFlask Sqlalchemy : Keyerror
I am trying to create a database relation between the Article, Author and Category class, when trying to create an Article class object I get the error "Keyerror: "article" referring to the line…
-
1
votes1
answer286
viewsDeploy flask application on Heroku with flask-sqlalchemy
I have a small application written in flask and I am having problems with the database when trying to deploy in Heroku and after searching for two days I did not find any solution that suits me. In…
-
1
votes1
answer149
viewsForeignkey error with Sqlalchemy
Basically what I want is for him to register in Transaction() the Account he sends and the Account he receives the amount. However I am not able to link the two Foreign key with the accounts I am…
-
1
votes1
answer260
viewsList Python-flask logged-in user post
I’m a beginner in flask and I’m doing an Appweb where the user can register and register and post, is a Virtual Arline system. I built the user with SESSION and can display only his data. In my…
-
1
votes0
answers90
viewsSeparate related models in Sqlalchemy
I have a model of relational tables: models/Base.py from collections import OrderedDict from src.config.database import db class Base(db.Model): __abstract__ = True models/Model.py from .Base import…
-
1
votes0
answers115
viewsAttributeerror: 'Nonetype' Object has no attribute 'append'
A relationship Many to Many between the table Patient and Illnesses, and Patient and Allergies I am with the following problem. pacientes_alergias = db.Table('pacientes_alergias',…
-
1
votes2
answers67
viewsIs there a better way to deal with relational and non-relational databases in the same project?
I am refactoring a code, where I process some data and send it to a database. I have two versions. One where I use Mongodb and the other where I use Mysql. But I’d like to put the two versions…
-
0
votes0
answers35
viewsPython - CTR class does not register in DB
Good night. Application developed in Python 3.x Database: sqlalchemy. I’m trying to develop a simple product registration system in an SQL database. For this, I am trying to develop from the MVC…
-
0
votes1
answer420
viewsHow to test connection to Mysql database (sqlalchemy)
I started learning unit tests recently, Not I know if unit testing is really the term I’m looking for, but how can I "test" the database connection ?
-
0
votes1
answer191
viewsExport from pandas to MS SQL using to_sql and sqlalchemy
My problem is with Float values example: df = pd.DataFrame([1.45]) conn_str = 'mssql+pyodbc:///?odbc_connect={}'.format(params) engine = create_engine(conn_str) df.to_sql(name='teste',con=engine,…
-
0
votes1
answer293
viewsPython Error SQLACHEMY
Is giving an error when I try to connect to SQL SERVER database with SQLALCHEMY from sqlalchemy import create_engine, engine import pandas as pd engine =…
sql python sql-server python-3.x sqlalchemyasked 6 years, 1 month ago André Felipe Jardim Firmo 127 -
0
votes0
answers159
viewsQ: SQL login check ALCHEMY Pending
I am creating a login to give access to the tool I am starting to create, the database is SQL Server The structure of the project is this: ├── Project │ ├── Controllers │ │ ├── __init__.py │ │ └──…
-
0
votes1
answer377
viewsin Sqlalchemy what is the difference between filter and filter_by
Is there any difference between the function filter and filter_by in Sqlalchemy? If it exists, when should I use each of them properly?
-
0
votes0
answers37
viewsWho connects to the Sqlalchemy database?
I have an app that uses Sqlalchemy’s ORM, but I’m confused about this connection. It is Sqlalchemy or the connection driver (in my case psycopg2) that actually connects to the database?…
-
0
votes1
answer146
viewsArithmetic calculations (sum) in the Flask-Sqlalchemy database
I have a table in my database that the user places the total flight hours he has done. I wanted to know how to add all the hours of the user who is in the database and show in templates. Backend:…
-
0
votes1
answer118
viewsAttributeerror- Sqlalchemy Flask
'str' Object has no attribute 'contains' I am trying to create a query using Flask-Sqlalchemy Flask should return me a list of books according to the user’s search. It selects 4 search options and…
-
0
votes0
answers29
viewsError importing Sqlalchemy
I cannot import flask_sqlalchemy even after installing from flask import Flask, render_template from flask_sqlalchemy import SQLAlchemy ^aqui mostra o erro: ImportError: "flask_sqlalchemy" could not…
-
0
votes0
answers190
viewsInsert data into Postgresql using Dataframe Pandas
Prazados, I am working on a particular project in which I want to do an ETL with Python and Postgresql. I intended to consume a GET API using request, persist this data in a Dataframe and after…
-
0
votes1
answer34
viewsPython+HTML+Sqlalchemy error
Hello I am trying to do a simple procedure, but I stopped at the problem below. I have the simple goal of passing a parameter and filtering a list of associates. I have the following codes: Python…
-
0
votes0
answers33
viewsHow to search for array in postgres through sqlalchemy?
My database has a column like ARRAY(sa.BIGINT). My intention is to use the command filter_byof sqlalchemy to search for an element that has the list_secao_id field equal to [58,45,12], for example:…
-
0
votes1
answer51
viewsDifficulty passing column in filter_by as parameter in Python3 function with Sqlalchemt
I’m using Sqlalchemy to work with database tables. I am creating classes for the proper tables, where I have as methods of these classes, Insert, filter_all(), etc. I’m using the following class…
-
0
votes1
answer138
viewsHow to filter records per month in Python / Flask
Hey, guys. All right? I started learning programming some time ago and took advantage of this quarantine to give a gas and manage to create my first system - a voucher/advance manager. It’s simple,…
-
0
votes1
answer147
viewsWhat does backref mean in relation tables Many to Many in Sqlalchemy?
I am creating a database template in my models.py for my Flask application. I have a User table, and each user can have multiple instruments, and one instrument can have multiple users. In the…
-
0
votes1
answer146
viewsSerialize in flask-marshmallow with relationship
I’m using the flask-marshmallow to make the serialize in my project. Along with it I am using flask-sqlalchemy for mapping my tables. Follows the structure: models/Area.py: config.database import db…
-
0
votes1
answer61
viewsConvert a sqlalchemy query to a dictionary - Python
I have this consultation made with SQLalchemy ORM, where table_schema contains an example of sqlalchemy column nq = session.query(Base.table_schema).filter(Base.tablename == 'stores').scalar() The…
-
0
votes0
answers32
viewsError relating tables in Sqlalchemy
I have two classes mapped: User and Contact with one-to-many relationship (User.). from sqlalchemy import Column, ForeignKey, Integer, String, UniqueConstraint from sqlalchemy.orm import…
-
0
votes1
answer59
viewswhen trying to create a bank with flask_sqlalchemy Attributeerror: can’t set attribute
Making a Flask app, I had some difficulties with the database, and followed the following steps in VSCODE: I created a virtual environment, installed via Pip flask and other libs I created the first…
-
0
votes1
answer36
viewsAttributeerror: type Object 'User' has no attribute 'order_by' - Sqlalchemy
I am trying to sort the Transaction table id accordingly: from sqlalchemy import desc from sqlalchemy.orm import query from website.models import Transaction def home(): transactions =…
-
-1
votes1
answer24
viewsDifficulty to pass update column as parameter in Python3 function with Sqlalchemy
I’m using Sqlalchemy to work with database tables. I am creating classes for the proper tables, where I have as methods of these classes, Insert, filter_all(), etc. I’m using the following class…
-
-2
votes1
answer38
viewspandas and sqlalchemy
Hello, I’m trying to create a mysql database connection in a python program, follow the code import pandas as pd import sqlalchemy engine =…
-
-3
votes1
answer39
viewshow to transform this query to flask sqlalchemy object-oriented
I’ve been trying to do this for three days, I even managed to make it work directly in the database, but object-oriented in flask with sql Alchemy was not. select cod_quest from questoes a where…