Skip to content

Commit 29e8629

Browse files
refactor: adapt imports to FastCRUD 0.19.0 pagination structure.
1 parent 1f89add commit 29e8629

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

docs/user-guide/api/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def get_users(db: Annotated[AsyncSession, Depends(async_get_db)]):
3131
async def create_user(
3232
user_data: UserCreate,
3333
db: Annotated[AsyncSession, Depends(async_get_db)]
34-
):
34+
):
3535
return await crud_users.create(db=db, object=user_data)
3636
```
3737

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

5555
@router.get("/", response_model=PaginatedListResponse[UserRead])
5656
async def get_users(page: int = 1, items_per_page: int = 10):

docs/user-guide/api/pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This guide shows you how to add pagination to your API endpoints using the boile
77
Here's how to add basic pagination to any endpoint:
88

99
```python
10-
from fastcrud.paginated import PaginatedListResponse
10+
from fastcrud import PaginatedListResponse
1111

1212
@router.get("/", response_model=PaginatedListResponse[UserRead])
1313
async def get_users(

docs/user-guide/database/crud.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ async def user_management_example(db: AsyncSession):
392392
Using FastCRUD's pagination utilities:
393393

394394
```python
395-
from fastcrud.paginated import compute_offset, paginated_response
395+
from fastcrud import compute_offset
396+
from fastcrud import paginated_response
396397

397398
async def get_paginated_users(
398399
db: AsyncSession,

docs/user-guide/database/schemas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ users = await crud_users.get_multi(
402402
For pagination with page numbers, use `PaginatedListResponse`:
403403

404404
```python
405-
from fastcrud.paginated import PaginatedListResponse
405+
from fastcrud import PaginatedListResponse
406406

407407
# In API endpoint - ONLY for paginated list responses
408408
@router.get("/users/", response_model=PaginatedListResponse[UserRead])

docs/user-guide/development.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ Create `src/app/api/v1/categories.py`:
136136
from typing import Annotated
137137

138138
from fastapi import APIRouter, Depends, HTTPException, Request
139-
from fastcrud.paginated import PaginatedListResponse, compute_offset
139+
from fastcrud import PaginatedListResponse
140+
from fastcrud import compute_offset
140141
from sqlalchemy.ext.asyncio import AsyncSession
141142

142143
from ...api.dependencies import get_current_superuser, get_current_user

docs/user-guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ Ready to dive in? Here are recommended learning paths:
8383
3. Set up [Background Task Processing](background-tasks/index.md)
8484
4. Review the [Production Guide](production.md) for deployment considerations
8585

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

0 commit comments

Comments
 (0)