I'm using SQLalchemy and have entered data into the database:
class Directions(db.Model):
id = db.Column(db.Integer, primary_key=True)
key = db.Column(db.String(16), index=True, unique=False)
Now, I'm trying to search for a given key:
Directions.query.filter(Directions.key=={some string})
But I get:
<flask_sqlalchemy.BaseQuery object at 0x103df57b8>
How do I uncover the actual string? I just spent two hours searching through the documentation, but that 1319 page haystack is not being useful.
Try using this:
direction = Directions.query.filter_by(key == <some string>).first()
print(direction)
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