Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/user-guide/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def get_users(db: Annotated[AsyncSession, Depends(async_get_db)]):
async def create_user(
user_data: UserCreate,
db: Annotated[AsyncSession, Depends(async_get_db)]
):
):
return await crud_users.create(db=db, object=user_data)
```

Expand All @@ -50,7 +50,7 @@ async def get_profile(current_user: Annotated[dict, Depends(get_current_user)]):
### 📊 **Easy Pagination**
Paginate any endpoint with one line:
```python
from fastcrud.paginated import PaginatedListResponse
from fastcrud import PaginatedListResponse

@router.get("/", response_model=PaginatedListResponse[UserRead])
async def get_users(page: int = 1, items_per_page: int = 10):
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/api/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This guide shows you how to add pagination to your API endpoints using the boile
Here's how to add basic pagination to any endpoint:

```python
from fastcrud.paginated import PaginatedListResponse
from fastcrud import PaginatedListResponse

@router.get("/", response_model=PaginatedListResponse[UserRead])
async def get_users(
Expand Down
3 changes: 2 additions & 1 deletion docs/user-guide/database/crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ async def user_management_example(db: AsyncSession):
Using FastCRUD's pagination utilities:

```python
from fastcrud.paginated import compute_offset, paginated_response
from fastcrud import compute_offset
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just import both in the same line

from fastcrud import paginated_response

async def get_paginated_users(
db: AsyncSession,
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/database/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ users = await crud_users.get_multi(
For pagination with page numbers, use `PaginatedListResponse`:

```python
from fastcrud.paginated import PaginatedListResponse
from fastcrud import PaginatedListResponse

# In API endpoint - ONLY for paginated list responses
@router.get("/users/", response_model=PaginatedListResponse[UserRead])
Expand Down
3 changes: 2 additions & 1 deletion docs/user-guide/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ Create `src/app/api/v1/categories.py`:
from typing import Annotated

from fastapi import APIRouter, Depends, HTTPException, Request
from fastcrud.paginated import PaginatedListResponse, compute_offset
from fastcrud import PaginatedListResponse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here as well

from fastcrud import compute_offset
from sqlalchemy.ext.asyncio import AsyncSession

from ...api.dependencies import get_current_superuser, get_current_user
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ Ready to dive in? Here are recommended learning paths:
3. Set up [Background Task Processing](background-tasks/index.md)
4. Review the [Production Guide](production.md) for deployment considerations

Choose your path based on your needs and experience level. Each section builds upon previous concepts while remaining self-contained for reference use.
Choose your path based on your needs and experience level. Each section builds upon previous concepts while remaining self-contained for reference use.