uranusjr/django-tutorial-for-programmers

`07-django-models.md` 的 `models.ForeignKey` 現在需要on_delete

doomleika opened this issue · 0 comments

class MenuItem(models.Model):

    store = models.ForeignKey('Store', related_name='menu_items')
    name = models.CharField(max_length=20)
    price = models.IntegerField()

    def __str__(self):
        return self.name

現在models.ForeignKey的 on_delete是必要參數