mirror of
https://github.com/django/django.git
synced 2025-10-04 07:46:37 +00:00
Fixed #26320 -- Deprecated implicit OneToOnField parent_link.
This commit is contained in:
parent
9e4e20a71c
commit
87338198e9
8 changed files with 40 additions and 22 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue