ManyRelatedField does not seem to run validators of child relation #8698
Replies: 1 comment
-
Interesting. I can see that the Here's django-rest-framework/rest_framework/fields.py Lines 1665 to 1676 in 1fd268a Which calls into django-rest-framework/rest_framework/fields.py Lines 1684 to 1698 in 1fd268a There's no equivalent in django-rest-framework/rest_framework/relations.py Lines 520 to 529 in 1fd268a I don't know if we're able to change this or if there's reason that'd break existing behaviour. Best I can suggest would be someone working on a pull request to bring |
Beta Was this translation helpful? Give feedback.
-
When using a
PrimaryKeyRelatedField
withmany=True
, itsvalidators
are not run on list items.Example:
(Using a
ListField
withchild=PrimaryKeyRelatedField(validators=[validate_object], queryset=SomeModel.objects.all())
works, though.)Beta Was this translation helpful? Give feedback.
All reactions