Coder Social home page Coder Social logo

Comments (8)

uriyyo avatar uriyyo commented on June 10, 2024

@sakthiRathinam Could you please provide more context? It will be great if you can provide example of what you want

from fastapi-pagination.

sakthiRathinam avatar sakthiRathinam commented on June 10, 2024

i need whether the previous and next page of that paginate is available...some bool like prev:True ,next:False like this

from fastapi-pagination.

uriyyo avatar uriyyo commented on June 10, 2024

In case if prev or next page is not available you will receive None as a value.

from fastapi-pagination.

sakthiRathinam avatar sakthiRathinam commented on June 10, 2024

but im nt getting anything like prev or next

from fastapi-pagination.

sakthiRathinam avatar sakthiRathinam commented on June 10, 2024

{
"items": [
{
"id": 2147483647,
"created": "2021-10-19T09:50:00.207Z",
"updated": "2021-10-19T09:50:00.207Z",
"max_retial_price": 0,
"type": "Capsules",
"title": "string",
"brand": "string",
"active": false
}
],
"total": 0,
"page": 1,
"size": 1
}

from fastapi-pagination.

sakthiRathinam avatar sakthiRathinam commented on June 10, 2024

total": 0,
"page": 1,
"size": 1 this three extra fields only im gettting

from fastapi-pagination.

sakthiRathinam avatar sakthiRathinam commented on June 10, 2024

@clinto_router.get('/paginateMedicines', response_model=Page[GET_Medicine])
async def paginate_mediciens(request: Request) -> any:
medicines = await paginate(Medicine.all())

im using fastapi and tortoise-orm

from fastapi-pagination.

uriyyo avatar uriyyo commented on June 10, 2024

Hi @sakthiRathinam,

Try import Page from fastapi_pagination.links:

from fastapi_pagination.links import Page

@clinto_router.get('/paginateMedicines', response_model=Page[GET_Medicine])
async def paginate_mediciens(request: Request) -> any:
    medicines = await paginate(Medicine.all())

from fastapi-pagination.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.