File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,15 @@ def get_related_resource_type(relation):
242
242
relation_model = parent_model_relation .related .related_model
243
243
else :
244
244
relation_model = parent_model_relation .related .model
245
+ elif parent_model_relation_type is ManyToManyDescriptor :
246
+ relation_model = parent_model_relation .field .remote_field .model
247
+ elif parent_model_relation_type is ReverseManyRelatedObjectsDescriptor :
248
+ relation_model = parent_model_relation .field .related .model
249
+ elif parent_model_relation_type is ReverseGenericManyToOneDescriptor :
250
+ if django .VERSION >= (1 , 9 ):
251
+ relation_model = parent_model_relation .rel .model
252
+ else :
253
+ relation_model = parent_model_relation .field .related_model
245
254
elif hasattr (parent_model_relation , 'field' ):
246
255
try :
247
256
relation_model = parent_model_relation .field .remote_field .model
You can’t perform that action at this time.
0 commit comments