Answers for "passing user instance django form submission"

1

passing user instance django form submission

if form.is_valid():
    post = form.save(commit=False)
    post.author = request.user
    post.published_date = timezone.now()
    post.save()
Posted by: Guest on December-20-2020

Python Answers by Framework

Browse Popular Code Answers by Language