Re: self.request in APIView

2020-01-15 Thread Yiran Hu
Yes that makes sense! On Wednesday, January 15, 2020 at 7:57:45 AM UTC-5, Jason wrote: > > `create` is the direct handler for any POST requests that come in. So, it > needs to have `request` in there, because its a subclass of > `django.views.generic.View` View handlers need to implement the p

Re: self.request in APIView

2020-01-14 Thread Yiran Hu
ecking these links to see if it helps: > > > https://stackoverflow.com/questions/53319230/what-is-the-difference-between-the-create-and-perform-create-methods-in-django-r?noredirect=1&lq=1 > > https://www.django-rest-framework.org/api-guide/generic-views/ > > > El

self.request in APIView

2020-01-14 Thread Yiran Hu
Hi Folks! New here and thanks for being such a supportive community! I was using a CreateAPIView and overrode the perform_create() method to add the request user object to the ModelSerializer. Now I see that create() method has a request in the parameter while perform_create() doesn't, but you