I am trying to import data into existing database items. There are two fields that I want to update for each data base item: a string type field caled
imagefolder and a picketype (list) field called
images. The input values for both fields are strings that store file paths.
My steps are to query the database item, check for its existance, and then update its fields.
blend = Blend.query.filter_by(old_ID=row).first() if blend: blend.imagefolder = "/".join((row.split("/")[4:])[:-1]) blend.images.append(ntpath.basename(row)) db.session.commit()
When I run the script nothing happens (the database doesn’t update), and I noticed that the import script runs really quickly, too quickly.