#Inherited Serializers Validation
4 messages · Page 1 of 1 (latest)
You could override the validation logic by redefining the functions on the subclass and not call super().
even if ... i have in serializer A field called user_id and serializer b field called image_id and my class is
def validate_user_id(self, user_id):
--- validation A ---
and serializer B
def validate_image_id(self, image_id):
--- validation B ---
when i use serializer A it validate serializer B first without even calling super()
Hmm. Maybe. You'd have to do some weird stuff. You may be better creating a separate serializer to avoid this problem entirely.