So i saw in this answer:
http://stackoverflow.com/a/11072057/1061426
that someone said:
Change this line:
form = StatementForm(request.POST, initial={'time': d.strftime("%Y-%m-%d %H:%M:%S"), 'user':loggedin_user, 'views':0})
For this:
form = StatementForm(initial={'time': d.strftime("%Y-%m-%d %H:%M:%S"),'user':loggedin_user, 'views':0})
What is the difference between including the request.POST and not? Or, more to the point - if value X isn't set in request.POST, but is included in the initial array, what value of X does the is_valid() method see?
EDIT: I guess what i'm asking is ~ which takes precedence in the above? If request.POST and an initial are added, does the initial value overwrite the request.POST value? Is an "empty" value able to be overwritten?
(In the question i relate to, the author was mistakingly using request.POST to seed the StatementForm when the method was a get, which was causing problems for him. )