According to request.method I want to change dehydrate my data.
e.x.
Psudo Code:
model bookmark:
title
desc
last_operation = [ choice ]
BookmarkSerializer():
model
fields
.to_internal_value(self, data)
if request.get:
return { title, desc, last_operation=GET }
return { last_operation : "POST", title, desc }
if request.patch:
return { last_operation : "PATCH", title, desc }
I know we can achieve this in VIEWSET or Serializer's method. I'm just curious to know whether we can access >> request << in to_internal_value()
thanks in advance.