I have some files and info about them is in a SQL db. For a given group of files, they will all share a common gallery_id(text) and different upload_time(datetime). I'm trying to get a list of files that all share a common gallery id and then sort them by upload_time, but it isn't working. This is the syntax I used:
>>> foo = Storedfile.query.filter_by(
gallery_id ='kgLivY').all().order_by(Storedfile.upload_time)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'order_by'
What am I doing wrong here?