Skip to content

Commit 85a6231

Browse files
Update performance.md
1 parent 5576eb7 commit 85a6231

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

docs/performance.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ notifications = get_notifications(user).prefetch_related(
7777
)
7878
```
7979

80-
**Warning**: This approach has serious limitations:
81-
82-
- You need to know the target's type and relationships in advance
83-
- Only works when ALL notifications in the queryset have the same target model type
84-
- It will raise `AttributeError` with heterogeneous targets (different model types) - if even one notification has a different target type that lacks the specified relationship, the entire query will fail
85-
- Each additional relationship level requires explicit prefetching
80+
> [!WARNING]
81+
> This approach has serious limitations:
82+
>
83+
> - You need to know the target's type and relationships in advance
84+
> - Only works when ALL notifications in the queryset have the same target model type
85+
> - It will raise `AttributeError` with heterogeneous targets (different model types) - if even one notification has a different target type that lacks the specified relationship, the entire query will fail
86+
> - Each additional relationship level requires explicit prefetching
8687
8788
#### For best performance
8889

0 commit comments

Comments
 (0)