Skip to content

Commit

Permalink
Merge pull request #638 from ZuluPro/doc_fk
Browse files Browse the repository at this point in the history
Fixed ForeignKey.on_delete
  • Loading branch information
Asif Saif Uddin committed Sep 16, 2019
2 parents 3f44205 + a9d3303 commit 5cb690f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/custom_tagging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ model named ``content_object``. Pass this intermediary model as the


class TaggedFood(TaggedItemBase):
content_object = models.ForeignKey('Food')
content_object = models.ForeignKey('Food', on_delete=models.CASCADE)

class Food(models.Model):
# ... fields here
Expand Down Expand Up @@ -135,7 +135,8 @@ model named ``"tag"``:
# Here is where you provide your custom Tag class.
tag = models.ForeignKey(MyCustomTag,
related_name="%(app_label)s_%(class)s_items")
related_name="%(app_label)s_%(class)s_items",
on_delete=models.CASCADE)
class Food(models.Model):
Expand Down

0 comments on commit 5cb690f

Please sign in to comment.