Skip to content

Commit 21f38a3

Browse files
committed
Replaced the use of a deprecated Django field attribute with the sanctioned replacement.
- Legacy-Id: 15315
1 parent e87442f commit 21f38a3

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

ietf/api/management/commands/makeresources.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def handle_app_config(self, app, **options):
9898
#debug.show('field.name')
9999
#debug.pprint('dir(field.remote_field.to)')
100100
#exit()
101-
rel_app=field.remote_field.to._meta.app_label
102-
rel_model_name=field.remote_field.to.__name__
101+
rel_app=field.remote_field.model._meta.app_label
102+
rel_model_name=field.remote_field.model.__name__
103103
if rel_model_name == model_name:
104104
# foreign key to self class -- quote
105105
# the rmodel_name
@@ -111,10 +111,10 @@ def handle_app_config(self, app, **options):
111111
name=field.name,
112112
app=rel_app,
113113
module=rel_app.split('.')[-1],
114-
model=field.remote_field.to,
114+
model=field.remote_field.model,
115115
model_name=rel_model_name,
116116
rmodel_name=rmodel_name,
117-
resource_name=field.remote_field.to.__name__.lower(),
117+
resource_name=field.remote_field.model.__name__.lower(),
118118
))
119119
imports[rel_app]["module"] = rel_app
120120
imports[rel_app]["names"].append(rel_model_name)
@@ -124,10 +124,10 @@ def handle_app_config(self, app, **options):
124124
m2m_keys = []
125125
for field in model._meta.many_to_many:
126126
#debug.show('field.name')
127-
#debug.pprint('dir(field.remote_field.to)')
127+
#debug.pprint('dir(field.remote_field.model)')
128128
#exit()
129-
rel_app=field.remote_field.to._meta.app_label
130-
rel_model_name=field.remote_field.to.__name__
129+
rel_app=field.remote_field.model._meta.app_label
130+
rel_model_name=field.remote_field.model.__name__
131131
if rel_model_name == model_name:
132132
# foreign key to self class -- quote
133133
# the rmodel_name
@@ -139,10 +139,10 @@ def handle_app_config(self, app, **options):
139139
name=field.name,
140140
app=rel_app,
141141
module=rel_app.split('.')[-1],
142-
model=field.remote_field.to,
142+
model=field.remote_field.model,
143143
model_name=rel_model_name,
144144
rmodel_name=rmodel_name,
145-
resource_name=field.remote_field.to.__name__.lower(),
145+
resource_name=field.remote_field.model.__name__.lower(),
146146
))
147147
imports[rel_app]["module"] = rel_app
148148
imports[rel_app]["names"].append(rel_model_name)

0 commit comments

Comments
 (0)