Hi, Start by checking 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 mié., 15 ene. 2020 a las 0:12, Yiran Hu (<med...@gmail.com>) escribió: > 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 can use self.request . But I'm a little bit confused: > 1. Are the request parameter in the create() > <https://github.com/encode/django-rest-framework/blob/442a20650254bd24165ddd69654b6f855df8f386/rest_framework/mixins.py#L16> > method > the same as the self.request? > 2. If they are the same, why is there this request parameter? Is it to > conform to some other interface? > 3. If they are no the same, is it okay to use self.request.user as my user > object? (So far I don't see unwanted behavior so I assumed it's fine to use > it) > > Thanks! > > -- > 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 django-rest-framework+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-rest-framework/f4bed9b8-f73c-4ffc-83b9-59b97a1b1989%40googlegroups.com > <https://groups.google.com/d/msgid/django-rest-framework/f4bed9b8-f73c-4ffc-83b9-59b97a1b1989%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- -------- Gonzalo Amadio -- 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 django-rest-framework+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CANyTv7q-CAz7WdpmaYoNQvg%3DZXrhHdFeuX6QN39AxL9kTZVCFA%40mail.gmail.com.