Hi,

The Django REST Framework tutorial, step6 should show you how to do that.
The SnippetViewSet uses the SnippetSerializer to set the current user as the 
owner of the snippet created.

Regards,
Linovia,
Xavier O.

> Le 8 janv. 2021 à 12:43, Praveen chaduvala <pchaduv...@gmail.com> a écrit :
> 
> django - how to add current active user as foreign key to the create post 
> model in djangorestframework? - Stack Overflow 
> <https://stackoverflow.com/questions/65608353/how-to-add-current-active-user-as-foreign-key-to-the-create-post-model-in-django>
>   
> 
> -- 
> 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 
> <mailto:django-rest-framework+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-rest-framework/3c63250a-22f3-43f7-bcfd-833e422be73an%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-rest-framework/3c63250a-22f3-43f7-bcfd-833e422be73an%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/348387A6-FDB6-4FCC-B73B-3560DB524E0D%40linovia.com.

Reply via email to