pyae
1
How could I do pagination? The book doesn’t cover about that but I kinda feel pagination is important
0xtim
2
@pyae take a look at this community package:
pyae
3
@0xtim I saw that, but it doesn’t support sorting with other column field except id.
0xtim
4
You should be able to do it using the QueryBuilder
. Basically sort your items before you call paginate
. So it would be something like:
MyModel.query(on: req).sort(\.name, .ascending).paginate(on: req)
pyae
5
I did that but it shows error
@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]
0xtim
7
Have you imported Fluent?