Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8594089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:07:29+00:00 2026-06-12T00:07:29+00:00

So i saw in this answer: http://stackoverflow.com/a/11072057/1061426 that someone said: Change this line: form

  • 0

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. )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:07:31+00:00Added an answer on June 12, 2026 at 12:07 am

    initial is an argument used to set the initial value of the form at runtime.

    Now, request.POST is used to bind a form to post data. For example, while submitting a form from browser using POST all the relevant fields would be assigned to the form object that it can find in request.POST

    If X is not set in the form, the value is taken from the initial, if present.

    You can read up about initial here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I saw an answer in another question saying that this should work: using
I just saw this code in an answer: HTML <div class=thumbnail> <img src=http://placehold.it/50x50> <img
I am 90% sure I saw this answer on stackoverflow before, in fact I
I saw this great question and answer on StackOverflow on embedding an image in
I saw this in a answer by Marc Gravell, and I just don't see
I saw this thread here but didnt get any answer to my thoughts. for
So I saw this post which helped answer part of my question however now
After reading this question , i saw the answer by Naveen containing a link
I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
I saw this answer to a similar question , but it always scares me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.