building a database using SQLAchemy
Hello I kind of stuck in making a database for my flask application using SQLAlchemy. infact I’m watching a toturial for flask apps, everything was ok until I’ve reached this error: SQLAlchemy.create_all() got an unexpected argument ‘app’
building a database using SQLAchemy
Hello I kind of stuck in making a database for my flask application using SQLAlchemy. infact I’m watching a toturial for flask apps, everything was ok until I’ve reached this error: SQLAlchemy.create_all() got an unexpected argument ‘app’
SQLAlchemy-Utils Aggregated Attributes: How to apply filter before aggregating to create an aggregated field?
from sqlalchemy_utils import aggregated class Thread(Base): __tablename__ = ‘thread’ id = sa.Column(sa.Integer, primary_key=True) name = sa.Column(sa.Unicode(255)) @aggregated(‘comments’, sa.Column(sa.Integer)) def comment_count(self): return sa.func.count(‘1’) comments = sa.orm.relationship( ‘Comment’, backref=’thread’ ) class Comment(Base): __tablename__ = ‘comment’ id = sa.Column(sa.Integer, primary_key=True) content = sa.Column(sa.UnicodeText) thread_id = sa.Column(sa.Integer, sa.ForeignKey(Thread.id)) active = sa.Column(sa.Boolean) I want the comment_count field to be count […]
flask error (sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: user) and more
Hello. I used Miguel Grinberg’s Flask Microblog for a project of mine. I downloaded the latest version and opened it in visual studio code . I downloaded the necessary libraries and set up the virtual environment. When I start it up, for example when I want to register a user, I get the OperationalError sqlalchemy.exc.OperationalError: […]
Databases don’t save the information’s
I’ve been working on a Flask application for a college project, and I’m facing an issue where the data isn’t getting saved to the database. Everything seems to work fine, but for some reason, the data isn’t persisting.
Flask-SQLAlchemy. Don’t create relations in second base
After the tables started being created upon server startup, there were no problems, but now I get an error with every request.
Flask-SQLAlchemy. How create tables in second base
I’m struggling to create tables in the second database. I’ve tried many options, but the tables just won’t create. If I use the main database (without specifying binds), everything creates and works fine, but in the second database, using db.Table, no tables are created (tables created through classes work without any issues)
Import “sqlalchemy” could not be resolved
after setting up my virtual env and installing sqlalchemy
, I created a file src/entities/entity.py
, putting this code: