Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

call update in create method django viewset

# call this code from create method with a pk to update (if exists)
self.kwargs["pk"] = str(query_set[0].pk)
return self.update(request, *args, **kwargs)
Source by www.django-rest-framework.org #
 
PREVIOUS NEXT
Tagged: #call #update #create #method #django #viewset
ADD COMMENT
Topic
Name
8+2 =