Questions tagged [flask-sqlalchemy]
Flask-SQLALchemy is an extension for Flask that provides SQLAlchemy support. It is designed to make database manipulation through SQLAlchemy even easier and simpler. It has the same three clause BSD License as Flask.
flask-sqlalchemy
7,139
questions
0
votes
0
answers
44
views
Access to XmlHtppRequest
I'm working on a small project where I'm connecting a React frontend to a Flask backend. Both servers are running fine, but when I try to sign up or login, I encounter this error:
Access to ...
1
vote
1
answer
27
views
SQLAlchemy not retrieving data from schema.sometable
I am having trouble having the query produce results. I know there is 1 value in the table, but I cannot get the data to show in Python.
I am also not getting any errors in the run.
I have the ...
0
votes
0
answers
15
views
Flask app builder extend base model and add extra column to it
I want to know how I can extend flask app builder base models. Example I have User model in flask_appbuilder/security/sqla
class User(Model):
__tablename__ = "ab_user"
id = Column(...
0
votes
0
answers
37
views
Backend DB : 'str' object has no attribute '_sa_instance_state'
I am learning to use vu.js on my own. So my knowledge so far is nearly nonexistent. I tried to make sense of posts that have the same issue, but I could not find my solution.
First, here is my problem:...
0
votes
0
answers
18
views
How to add extra column in Role model in apache superset
I am trying to extend Role model of apache superset and add channel_id as extra column. I have done it through superset_config.py and it looks like this.
import flask_appbuilder.const as c
import ...
0
votes
1
answer
28
views
Unable to import WTForm class from one file to another
I am unable to import NamerForm from forms.py to controllers.py. Getting ImportError
ImportError: cannot import NamerForm from application.forms
File Directory structure:
.venv
|____applications
|-...
0
votes
0
answers
13
views
Remove orphans when the parent entry is deleted using ORM: SQLmodel
What I am trying to achieve is to have the prices deleted the second I remove a product, as there is no point in having them without a parent. I have tried different solutions yet to no avail.
class ...
0
votes
0
answers
20
views
AttributeError: module 'database.db' has no attribute 'Model'
app.py
from flask import Flask, jsonify
from flask_jwt_extended import JWTManager
from flask_migrate import Migrate
from flask_cors import CORS
import secrets
from api.user_controller import user_bp
...
0
votes
0
answers
36
views
How do I upload an Excel sheet and show its data on the page?
models.py (database schemas):
from app import db, login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class ...
0
votes
0
answers
30
views
How do I commit data from a flask form (inside of a modal) to an SQL Database?
I'm pretty new to Flask and struggling with transferring data from a form to an SQL Database. The form is within a modal, which works perfectly and will redirect back to the main page once the form is ...
0
votes
1
answer
28
views
How to use FileField within WTForms FieldList? Using Flask-WTF for FileField
I have created dynamic fields using WTForms FieldList, macros and Javascript.
Using this code to validate many fields (StringField, SelectField etc) I can add many fields dynamically, and they ...
0
votes
1
answer
33
views
Pinotdb error (pinotdb.exceptions.DatabaseError) {'errorCode': 150... when trying to initialize apache-pinot db from apache-superset
while setting up Apache-Superset (I installed Superset on Ubuntu 22.04 over pypi, for the connector im using pinotdb, to connect Superset to a apache-pinot db.) i encountered following error after ...
0
votes
0
answers
21
views
SqlAlchemy join load parent tables
I have three tables with relationshps on them:
class A(db.Model):
__tablename__ = 'table_a'
id: Mapped[int] = mapped_column(primary_key=True)
bs: Mapped[List['B']] = relationship(
...
2
votes
1
answer
38
views
how to "translate" this sql line to work on flask/sqlalchemy?
I need some help to translate a sql command to work on Flask.
I am trying to filter the results of a query. This command below do what I need in mysql:
select t.date, t.name from `capacitydata`.`...
1
vote
1
answer
49
views
Even if SQLALCHEMY_POOL_RECYCLE is set, Flask-SQLAlchemy will not automatically recycle MySQL connections
Recently, my flask program encountered the error of Lost connection to MySQL server during query. I searched some documents and discussions. It seems that MySQL timed out and disconnected the ...