django get data from form code example
Example 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()
Example 2: django get form id from request
# html
<input type="submit" value="Reply" name ="message_frm">
# views.py
if 'message_frm' in request.POST:
#do somethings