Im using python, flask and sqlalchemy have the query below: Now let’s assume that i want to search for the condition Foo1.id != 2 but still make sure that i meet the condition of the query above, what would be the best way to achieve that (i am trying to learn how to do subquery or filter in another query
Tag: flask
Flask ‘render_template’ after client POST request
So, I’m working on a small web application that has a small canvas, the user is supposed to draw something and then I want to do some python with the image from that canvas. Like this: This is working fine. When I press “Click me!”, I call a JS function that POST the image to my Flask server. And this
Flask-SQLAlchemy: ‘Table’ object has no attribute ‘query_by’
I’m developing an API with Flask and I cannot retrieve queries from a MySQL database I’ve connected with flask-sqlalchemy (not sqlalchemy alone). This is a pre-existing database downloaded from my client’s PHPMyAdmin, so I haven’t ran db.create_all(): I simply created the connection string in config.py, then instantiated db = SQLAchemy() and initialized it (db.init_app(app)) in my factory function (i’m using
How to upload a (csv) file with an AJAX call and Flask
I’m updating on updating an older project that uses AJAX and have decided to use Flask to do so. For the particular page I’m currently working on, I need to be able to upload a CSV and read the data in the file (no need to save it). I have several other pages that work using AJAX, but they return
Using SQLAlchemy, I need to assign users into pools, and a ranking for each pool they’re in
Here is the relevant code. I’m writing a Flask application where users can join pools and compete against others within those pools (currently, pools and users are in a many to many relationship). Each user will need a rating for each pool that he/she is in (Elo Rating), and I’m not sure how to implement that into my existing structure.
upload multiple files with fetch
I am trying to receive more than one file per time using reactjs and flask api, but I get this error fontend code using reactjs backend code using flask flask receiving the files as [‘[object File],[object File]’] . I tried to find ways to read an object file but nothing worked can anyone help.. Answer I don’t use React but
Deleting FlaskForm Fields depending on userinput in other forms
I have 3 forms with Checkboxes to configure the desired form (Final_Form). After the user chooses the desired fields (in form1, form2 and form3), i want to delet all fields that are not required in the final form and render the final form. The reason for that is, that i have 3 Subkategories with around 12 possible values, in each
Image uploading in Flask blog with CKeditor 5
I’m stuck with following problem while creating my Flask based blog. Firstly, I used CKeditor 4 but than upgraded to 5 version. I can’t understand how to handle image upload on server side now, with adapters etc. As for 4 version, I used flask-ckeditor extension and Flask documentation to handle image uploading. I didn’t find any examples for this combination.
Database connection broken even with with SQLAlchemy pre-ping
Since I moved my database from a mssql docker container to an azure database as a service my web application( flask) is being disconnected after several minutes. It is simply solved by a refresh of the page but still, there is an issue here. The error raised by SQLAlchemy is an Operational Error (https://docs.sqlalchemy.org/en/14/errors.html#error-e3q8) I tried to implement the pool_pre_ping=True
How do I set the variables in this javascript file to match variables from Flask/Python?
I have a Javascript file that enables drop down menus dynamic (i.e. a selection from one drop down impacts the others). I would like to use this file in conjunction with multiple forms but I have hard-coded the starting variables in this file to html elements ‘inverter_oem’ and ‘inverter_model_name’. In other forms, I will need to reference different objects. How