Skip to main content

Usage

Supposing in myapp.schema you have a pydantic BaseModel to represent your model

from fastapi import Depends
from tortoise_pagination import Pagination, Page

from myapp.main import app
from myapp.models import MyModel
from myapp.schema import MySchema


@app.get('/mymodel')
async def my_view(pagination: Depends(Pagination.from_query)) -> Page[MySchema]:
    return await pagination.paginated_response(MyModel.all(), MySchema)

now you can request with:

curl http://localhost:8000/mymodel?offset=0&limit=20

returned structure:

  • items list[MySchema]
  • count: NonNegativeInt -> the number of entries for this queryset (MyModel.all().count()) wich the frontend will need to be able to display a pagination

Metadata

Release files for tortoise-pagination 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tortoise-pagination 1.4.0
File Size Uploaded Provenance Actions
tortoise_pagination-1.4.0.tar.gz 45.1 kB Without provenance Details for tortoise_pagination-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tortoise-pagination 1.4.0
File Interpreter ABI Platform Actions
tortoise_pagination-1.4.0-py3-none-any.whl Python 3 none any Details for tortoise_pagination-1.4.0-py3-none-any.whl

Total release size: 48.3 kB

Release files / tortoise_pagination-1.4.0.tar.gz

Download URL tortoise_pagination-1.4.0.tar.gz
Size 45.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c1f9a4e35411bd3f2683ace9c00fcb1bfb15bc83ceba5a5f0688c02413ba557c
BLAKE2b-256 checksum
How to use checksums
ae130bef88e2ba6218ae2035ec08b6693af63508eb4f01d49e8166656549df77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / tortoise_pagination-1.4.0-py3-none-any.whl

Download URL tortoise_pagination-1.4.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff63943ced488b3cc7a8f39ce6fedb2f2c96d359989827f3f7622957e6fb72fc
BLAKE2b-256 checksum
How to use checksums
578ca6faa06a71c93bec90a5851a102d6fce8b291c7cf2e1ab646b23463bf92e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for tortoise-pagination 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page