diff options
| author | Tim Graham <timograham@gmail.com> | 2016-04-22 12:59:41 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-22 12:59:41 -0400 |
| commit | 87338198e921d944cc241e59c827bb9dffef728b (patch) | |
| tree | 2b5abfd97e35159c20ad16b9ca38b106f885ac63 /django | |
| parent | 9e4e20a71c9648f8a1c6397ada40739d4aaa3ec6 (diff) | |
Fixed #26320 -- Deprecated implicit OneToOnField parent_link.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/options.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py index c6ddd2a6f9..74a362e99c 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -255,6 +255,11 @@ class Options(object): field = already_created[0] field.primary_key = True self.setup_pk(field) + if not field.remote_field.parent_link: + warnings.warn( + 'Add parent_link=True to %s as an implicit link is ' + 'deprecated.' % field, RemovedInDjango20Warning + ) else: auto = AutoField(verbose_name='ID', primary_key=True, auto_created=True) model.add_to_class('id', auto) |
