KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Given an example like this: class MyForm(forms.Form): name = forms.CharField() I'm trying to grasp what the difference between the following two snippets is: "Bound Data" style: my_form = MyForm({'name': request.user.first_name}) "Initial data" style: my_form = MyForm(initial={'name': request.user.first_name}) The documentation seems to suggest than "initial is for dynamic initial values", and yet being able to pass "bound data" to the constructor accomplishes exactly the same thing. I've used initial data in the past for dynamic values, but I'm tempted to use the more straightforward "bound data" style, but would like some insights about what the real difference between these two styles is.
Tags (comma-separated)
Save Edits
Cancel