I have a list with an order of insertion. I want to paginate the results using the same order. As you can see currently the output will be a different order.
following_companies_list_data = Company.query.filter(Company.id.in_(['2', '24', '1', '7', '373'])).paginate(
page, per_page=10, error_out=False)
companies = following_companies_list_data.items
for i in companies:
print i.id
7
24
373
2
1
related question