mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
This commit is contained in:
committed by
Tim Graham
parent
87d55081ea
commit
c2e70f0265
@@ -124,7 +124,7 @@ class Country(models.Model):
|
||||
@python_2_unicode_compatible
|
||||
class State(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
country = models.ForeignKey(Country)
|
||||
country = models.ForeignKey(Country, models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -158,7 +158,7 @@ class ProxyTrackerUser(TrackerUser):
|
||||
@python_2_unicode_compatible
|
||||
class Issue(models.Model):
|
||||
summary = models.CharField(max_length=255)
|
||||
assignee = models.ForeignKey(ProxyTrackerUser)
|
||||
assignee = models.ForeignKey(ProxyTrackerUser, models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return ':'.join((self.__class__.__name__, self.summary,))
|
||||
@@ -166,7 +166,7 @@ class Issue(models.Model):
|
||||
|
||||
class Bug(Issue):
|
||||
version = models.CharField(max_length=50)
|
||||
reporter = models.ForeignKey(BaseUser)
|
||||
reporter = models.ForeignKey(BaseUser, models.CASCADE)
|
||||
|
||||
|
||||
class ProxyBug(Bug):
|
||||
@@ -191,8 +191,8 @@ class Improvement(Issue):
|
||||
or to a proxy of proxy model
|
||||
"""
|
||||
version = models.CharField(max_length=50)
|
||||
reporter = models.ForeignKey(ProxyTrackerUser)
|
||||
associated_bug = models.ForeignKey(ProxyProxyBug)
|
||||
reporter = models.ForeignKey(ProxyTrackerUser, models.CASCADE)
|
||||
associated_bug = models.ForeignKey(ProxyProxyBug, models.CASCADE)
|
||||
|
||||
|
||||
class ProxyImprovement(Improvement):
|
||||
|
||||
Reference in New Issue
Block a user