Loading django/db/models/fields/related.py +6 −4 Original line number Diff line number Diff line Loading @@ -747,8 +747,9 @@ class ForeignKey(ForeignObject): if on_delete is None: warnings.warn( "on_delete will be a required arg for %s in Django 2.0. " "Set it to models.CASCADE if you want to maintain the current default behavior. " "on_delete will be a required arg for %s in Django 2.0. Set " "it to models.CASCADE on models and in existing migrations " "if you want to maintain the current default behavior. " "See https://docs.djangoproject.com/en/%s/ref/models/fields/" "#django.db.models.ForeignKey.on_delete" % ( self.__class__.__name__, Loading Loading @@ -977,8 +978,9 @@ class OneToOneField(ForeignKey): if on_delete is None: warnings.warn( "on_delete will be a required arg for %s in Django 2.0. " "Set it to models.CASCADE if you want to maintain the current default behavior. " "on_delete will be a required arg for %s in Django 2.0. Set " "it to models.CASCADE on models and in existing migrations " "if you want to maintain the current default behavior. " "See https://docs.djangoproject.com/en/%s/ref/models/fields/" "#django.db.models.ForeignKey.on_delete" % ( self.__class__.__name__, Loading tests/invalid_models_tests/test_relative_fields.py +6 −6 Original line number Diff line number Diff line Loading @@ -53,9 +53,9 @@ class RelativeFieldTests(IsolatedModelsTestCase): self.assertEqual( str(warns[0].message), 'on_delete will be a required arg for ForeignKey in Django ' '2.0. Set it to models.CASCADE if you want to maintain the ' 'current default behavior. See ' 'https://docs.djangoproject.com/en/%s/ref/models/fields/' '2.0. Set it to models.CASCADE on models and in existing ' 'migrations if you want to maintain the current default ' 'behavior. See https://docs.djangoproject.com/en/%s/ref/models/fields/' '#django.db.models.ForeignKey.on_delete' % get_docs_version(), ) Loading Loading @@ -90,9 +90,9 @@ class RelativeFieldTests(IsolatedModelsTestCase): self.assertEqual( str(warns[0].message), 'on_delete will be a required arg for OneToOneField in Django ' '2.0. Set it to models.CASCADE if you want to maintain the ' 'current default behavior. See ' 'https://docs.djangoproject.com/en/%s/ref/models/fields/' '2.0. Set it to models.CASCADE on models and in existing ' 'migrations if you want to maintain the current default ' 'behavior. See https://docs.djangoproject.com/en/%s/ref/models/fields/' '#django.db.models.ForeignKey.on_delete' % get_docs_version(), ) Loading Loading
django/db/models/fields/related.py +6 −4 Original line number Diff line number Diff line Loading @@ -747,8 +747,9 @@ class ForeignKey(ForeignObject): if on_delete is None: warnings.warn( "on_delete will be a required arg for %s in Django 2.0. " "Set it to models.CASCADE if you want to maintain the current default behavior. " "on_delete will be a required arg for %s in Django 2.0. Set " "it to models.CASCADE on models and in existing migrations " "if you want to maintain the current default behavior. " "See https://docs.djangoproject.com/en/%s/ref/models/fields/" "#django.db.models.ForeignKey.on_delete" % ( self.__class__.__name__, Loading Loading @@ -977,8 +978,9 @@ class OneToOneField(ForeignKey): if on_delete is None: warnings.warn( "on_delete will be a required arg for %s in Django 2.0. " "Set it to models.CASCADE if you want to maintain the current default behavior. " "on_delete will be a required arg for %s in Django 2.0. Set " "it to models.CASCADE on models and in existing migrations " "if you want to maintain the current default behavior. " "See https://docs.djangoproject.com/en/%s/ref/models/fields/" "#django.db.models.ForeignKey.on_delete" % ( self.__class__.__name__, Loading
tests/invalid_models_tests/test_relative_fields.py +6 −6 Original line number Diff line number Diff line Loading @@ -53,9 +53,9 @@ class RelativeFieldTests(IsolatedModelsTestCase): self.assertEqual( str(warns[0].message), 'on_delete will be a required arg for ForeignKey in Django ' '2.0. Set it to models.CASCADE if you want to maintain the ' 'current default behavior. See ' 'https://docs.djangoproject.com/en/%s/ref/models/fields/' '2.0. Set it to models.CASCADE on models and in existing ' 'migrations if you want to maintain the current default ' 'behavior. See https://docs.djangoproject.com/en/%s/ref/models/fields/' '#django.db.models.ForeignKey.on_delete' % get_docs_version(), ) Loading Loading @@ -90,9 +90,9 @@ class RelativeFieldTests(IsolatedModelsTestCase): self.assertEqual( str(warns[0].message), 'on_delete will be a required arg for OneToOneField in Django ' '2.0. Set it to models.CASCADE if you want to maintain the ' 'current default behavior. See ' 'https://docs.djangoproject.com/en/%s/ref/models/fields/' '2.0. Set it to models.CASCADE on models and in existing ' 'migrations if you want to maintain the current default ' 'behavior. See https://docs.djangoproject.com/en/%s/ref/models/fields/' '#django.db.models.ForeignKey.on_delete' % get_docs_version(), ) Loading