@@ -129,7 +129,7 @@ def extract_relationships(cls, fields, resource, resource_instance):
129
129
relation_data .append (
130
130
OrderedDict ([
131
131
('type' , relation_type ),
132
- ('id' , encoding .force_text (related_object .pk ))
132
+ ('id' , encoding .force_str (related_object .pk ))
133
133
])
134
134
)
135
135
@@ -168,7 +168,7 @@ def extract_relationships(cls, fields, resource, resource_instance):
168
168
relation_data = {
169
169
'data' : (
170
170
OrderedDict ([
171
- ('type' , relation_type ), ('id' , encoding .force_text (relation_id ))
171
+ ('type' , relation_type ), ('id' , encoding .force_str (relation_id ))
172
172
])
173
173
if relation_id is not None else None )
174
174
}
@@ -231,7 +231,7 @@ def extract_relationships(cls, fields, resource, resource_instance):
231
231
232
232
relation_data .append (OrderedDict ([
233
233
('type' , nested_resource_instance_type ),
234
- ('id' , encoding .force_text (nested_resource_instance .pk ))
234
+ ('id' , encoding .force_str (nested_resource_instance .pk ))
235
235
]))
236
236
data .update ({
237
237
field_name : {
@@ -264,7 +264,7 @@ def extract_relationships(cls, fields, resource, resource_instance):
264
264
265
265
relation_data .append (OrderedDict ([
266
266
('type' , nested_resource_instance_type ),
267
- ('id' , encoding .force_text (nested_resource_instance .pk ))
267
+ ('id' , encoding .force_str (nested_resource_instance .pk ))
268
268
]))
269
269
270
270
data .update ({field_name : {'data' : relation_data }})
@@ -287,7 +287,7 @@ def extract_relationships(cls, fields, resource, resource_instance):
287
287
'data' : (
288
288
OrderedDict ([
289
289
('type' , relation_type ),
290
- ('id' , encoding .force_text (relation_instance_id ))
290
+ ('id' , encoding .force_str (relation_instance_id ))
291
291
]) if resource .get (field_name ) else None )
292
292
}
293
293
})
@@ -486,7 +486,7 @@ def build_json_resource_obj(cls, fields, resource, resource_instance, resource_n
486
486
resource_name = utils .get_resource_type_from_instance (resource_instance )
487
487
resource_data = [
488
488
('type' , resource_name ),
489
- ('id' , encoding .force_text (resource_instance .pk ) if resource_instance else None ),
489
+ ('id' , encoding .force_str (resource_instance .pk ) if resource_instance else None ),
490
490
('attributes' , cls .extract_attributes (fields , resource )),
491
491
]
492
492
relationships = cls .extract_relationships (fields , resource , resource_instance )
0 commit comments