0

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()

Jeeva Kumar
  • 353
  • 2
  • 8

1 Answers1

1

Use "offset":

.limit(1).offset(1)
Aleks Andreev
  • 7,016
  • 8
  • 29
  • 37
coleifer
  • 24,887
  • 6
  • 60
  • 75