A
A
aial2016-12-16 22:55:28
Flask
aial, 2016-12-16 22:55:28

How to select all values ​​that match a filter in SQLAlchemy?

ResSeats.query.filter_by(res_id=id).first()here is the code that selects the first matched row. And I need to select all matching rows by filter.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2016-12-18
@dimonchik2013

.first() remove
type() see what it returns there, a list and not an object, judging by the error text

R
Roman, 2016-12-21
@skipirich

Replace first() with all()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question