I can get the SELECT id from parts where name='Part1'
as an SQL statement but what is the way to do that with SQLAlchemy?
I've tried;
db.session.query(Parts.id).filter(name=form.name.data)
But this returns an Object not the id
Use the below code.
parts = db.session.query(Parts).filter(Parts.name==Part1).first()
Then if you want the only id you can just access
parts.id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With