mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #28653 -- Added missing ForeignKey.on_delete argument in docs.
This commit is contained in:
parent
3fa0a824c2
commit
08c8c3ead9
4 changed files with 4 additions and 4 deletions
|
@ -1064,7 +1064,7 @@ fields. Suppose we have an additional model to the example above::
|
|||
|
||||
class Restaurant(models.Model):
|
||||
pizzas = models.ManyToManyField(Pizza, related_name='restaurants')
|
||||
best_pizza = models.ForeignKey(Pizza, related_name='championed_by')
|
||||
best_pizza = models.ForeignKey(Pizza, related_name='championed_by', on_delete=models.CASCADE)
|
||||
|
||||
The following are all legal:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue