The above problem gets resolved with the latest release of DRF i.e., ~3.12.0
It is mentioned about this issue in the first line itself here 3.12 Announcement <https://www.django-rest-framework.org/community/3.12-announcement/> PS: Posting it here so that, if someone faces this issues, can find this useful. Kind Regards, Manish On Wednesday, April 7, 2021 at 2:43:24 PM UTC+5:30 Manish Shah wrote: > I am having a nested serializer as:- > ``` > class DeviceConfigSerializer(serializers.ModelSerializer): > config = serializers.JSONField() > context = serializers.JSONField() > > class Meta: > model = Config > fields = ['backend', 'status', 'templates', 'context', 'config'] > > > class DeviceDetailSerializer(serializers.ModelSerializer): > config = DeviceConfigSerializer() > > class Meta(BaseMeta): > model = Device > fields = [ > 'id', > 'name', > 'organization', > 'mac_address', > 'key', > 'last_ip', > 'management_ip', > 'model', > 'os', > 'system', > 'notes', > 'config', > ] > def update(): > ... > ... > ... > > ``` > *views*:- > ``` > class DeviceDetailView(RetrieveUpdateDestroyAPIView): > serializer_class = DeviceDetailSerializer > queryset = Device.objects.all() > ``` > > When I try to get the data, I receive this:- > [image: Onsa2.png] > > But The data found in the HTML display form fields for the nested fields > is not satisfactory:- > [image: KJfVm.png] > > Can anyone help me with this? > PS: I have tried `to_represenation` and `to_internal_value` but that comes > with it's problem. > -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/06170a2e-2817-425c-a5ba-c1976b7c02abn%40googlegroups.com.
