Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in Statement-level triggers docs #175

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions docs/cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class TrackedModel(models.Model):
With this statement-level trigger, we have the benefit that only one additional query is performed, even on bulk inserts to the tracked model. Here's some example code to illustrate what the results look like.

```python
TrackedModel.objects.bulk_create([LoggedModel(field='old'), LoggedModel(field='old')])
TrackedModel.objects.bulk_create([TrackedModel(field='old1'), TrackedModel(field='old2')])

# Update all fields to "new"
TrackedModel.objects.update(field='new')
Expand All @@ -388,10 +388,10 @@ TrackedModel.objects.update(field='new')
print(HistoryModel.values('old_field', 'new_field'))

>>> [{
'old_field': 'old',
'old_field': 'old1',
'new_field': 'new'
}, {
'old_field': 'old',
'old_field': 'old2',
'new_field': 'new'
}]
```
Expand Down