mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
This commit is contained in:
parent
87d55081ea
commit
c2e70f0265
176 changed files with 1525 additions and 1008 deletions
|
@ -38,8 +38,8 @@ class Person(models.Model):
|
|||
"""
|
||||
first_name = models.CharField(max_length=200, help_text="The person's first name")
|
||||
last_name = models.CharField(max_length=200, help_text="The person's last name")
|
||||
company = models.ForeignKey(Company, help_text="place of work")
|
||||
family = models.ForeignKey(Family, related_name='+', null=True)
|
||||
company = models.ForeignKey(Company, models.CASCADE, help_text="place of work")
|
||||
family = models.ForeignKey(Family, models.SET_NULL, related_name='+', null=True)
|
||||
groups = models.ManyToManyField(Group, help_text="has membership")
|
||||
|
||||
def _get_full_name(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue