1๐
โ
If you look at the validated data you can see, the data belonging to MainRegisterSerializer
serializer will be available with register
key. And data belonging to RegisterSerializer
serializer will be available with file
key.
validated data :
{'register': OrderedDict([('username', 'test'), ('email', 'test@gmail.com'), ('password', 'test123')]), 'file': <InMemoryUploadedFile: filename.txt (text/csv)>}
so to access any fields for register you need to use:
validated_data['register']['username'], validated_data['register']['email'] ..etc.
for accessing the file you can use : validated_data['file']
๐คLiquidDeath
Source:stackexchange.com