I have a table(named sample) having some 100+ records and how can I write an api such that I want to fetch 'n' no of records as per index passed returning in json format,
for eg: if index=0 is passed i want to show first 0-5 records and for index=1 i want to show 6-10 records and so on.....
I have no idea to approach, but i am trying to fetch the index no. of records:
@app.route("/rows/<index>",methods=['GET'])
def getrecords():
records=sample.query.filter()[:index] # which would return top index no of records
got mute on how to fetch records based on index(as explained above )....any help is appreciated!!
I am looking for something like, if <index>=0
is passed then return a json of 0 to 5 records and if <index>=5
is passed then return a json of 6 to 10 and so on.....
This is actually asked for pagination ,but i need to see whether it works with (POSTMAN)