Category : sqlalchemy

i have objects from db and delete button. How to mark buttons to delete them correctly by id or something. My code doesn’t work, it delete only the last one. I use sqlalchemy with sqlite for db. def show_coaches(): col=0 row=0 for i in search_coach(): #returns arr objects e = tk.Label(frame_bottom, text=i.name, relief=tk.GROOVE) e.grid(row=row, column=col,padx=5, ..

Read more

I use Flask SqlAlchemy extension to access a SQL Server database for developing our API. The database has some columns are encrypted. To be able to decrypt these encrypted columns, I need to run the following statement before select/insert/update statements: OPEN SYMMETRIC KEY SymKey_MyApp DECRYPTION BY CERTIFICATE Certificate_MyApp Also I need to run the following ..

Read more

I’m trying the new sqlalchemy 1.4 select() syntax, but when executing this simple query, the result dict misses the column ‘graph’, but the result list includes it. import sqlalchemy as sa from source.Models import Quadrant, Graph engine = sa.create_engine("postgresql://blahblahblah") dbsession = sa.orm.Session(engine) stmt = sa.select( Quadrant.id, sa.text("array_agg(graph.data order by graph.id) as graphs") ).outerjoin( Graph, Quadrant.id ..

Read more

I’m new to coding. I have the code below: class Movie(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(250), unique=True, nullable=False) year = db.Column(db.Integer, nullable=False) description = db.Column(db.String(500), nullable=False) rating = db.Column(db.Float, nullable=True) ranking = db.Column(db.Integer, nullable=True) review = db.Column(db.String(250), nullable=True) img_url = db.Column(db.String(250), nullable=False) db.create_all() When I’m running the code I’m getting this error: Traceback ..

Read more

i try to filter my entity by column named valid and for this i apply simple filter below session.query(Mymodel).filter(Mymodel.valid !=True) The problem is that i have None, False, and True statement for valid field. How can i do correct filter to return False and None also? Source: Python..

Read more

Apologies for what may be confusing question so i have two separate problems one is the transposed() dataframe is resulting in redundant rows as shown in the code and i would like to get rid of these… & the second is that the error is showing up with "Data too long for column ‘Main Image ..

Read more