How to modify data after receiving from request.data

16 views
Skip to first unread message

laxmikanta nayak

unread,
Oct 11, 2019, 1:51:42 PM10/11/19
to Django users
Hi,

I am passing {message: 'here'} to a rest api then in rest api before saving to the db i want to modify it to {message:'here it it'}. at which step should i do the modification:
after reading from request.data using json dump and loads , or there is a way to modify the serializer.data ?

gaurav jain

unread,
Oct 11, 2019, 1:59:26 PM10/11/19
to django...@googlegroups.com
You can not modify the request.data object.
You can save it in a different variable and use that
Regards
Gaurav Jain

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c69968e2-ebf3-4573-bc08-18306b327eaf%40googlegroups.com.

laxmikanta nayak

unread,
Oct 12, 2019, 3:33:18 PM10/12/19
to Django users
Due to nested object its giving error when passed to serializer , but i will try this.


On Friday, October 11, 2019 at 7:29:26 PM UTC+5:30, gaurav jain wrote:
You can not modify the request.data object.
You can save it in a different variable and use that
Regards
Gaurav Jain

On Fri, 11 Oct, 2019, 7:20 PM laxmikanta nayak, <laxmikant...@gmail.com> wrote:
Hi,

I am passing {message: 'here'} to a rest api then in rest api before saving to the db i want to modify it to {message:'here it it'}. at which step should i do the modification:
after reading from request.data using json dump and loads , or there is a way to modify the serializer.data ?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages