Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
django set default value for model not form 1

django set default value for model not form

June 12, 2022 by Anurag batra
form = JournalForm(initial={'tank': 123})

Here is what the above code is Doing:
1. We’re creating a new instance of the JournalForm class.
2. We’re passing in an initial value for the tank field.
3. We’re assigning the form to the variable named form.

Categories Python Examples
Post navigation
change the color of the button on hovering tkinter
string pick the first 2 characters python
© MyEduKit - 2022 . All Rights Reserved.