I\'m new to Python and SQLAlchemy. I\'ve been playing about with retrieving things from the database, and it\'s worked every time, but im a little unsure what to do when the sel
the Usual way to work with orm queries is through the Session class, somewhere you should have a
engine = sqlalchemy.create_engine("sqlite:///...")
Session = sqlalchemy.orm.sessionmaker(bind=engine)
I'm not familiar with flask, but it likely does some of this work for you.
With a Session
factory, your application is instead
session = Session()
entries = session.query(Application) \
.filter_by(...) \
.all()
Your query is correct, you just need to change the way you interact with the result. The method you are looking for is all().
application = Applications.query.filter_by(brochureID=brochure.id)
entries = application.all()