mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26320 -- Deprecated implicit OneToOnField parent_link.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user