Jeeva Kumar
Jeeva Kumar

Reputation: 351

Get next row in peewee

I creating blog using Flask and peewee

this is the sample query to get the current post using url

total_data = wired_model.EN.select().order_by(wired_model.EN.id.desc())
post = total_data.where(wired_model.EN.url == url).get()

I am using total_data to get the recent posts, now I want to show a link to next post and the previous post in the current post, is there a simple way to do it in peewee like next_row()

Upvotes: 0

Views: 162

Answers (1)

coleifer
coleifer

Reputation: 26245

Use "offset":

.limit(1).offset(1)

Upvotes: 1

Related Questions