Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Unless I'm reading this incorrectly, this replaces fields with the values from a model. I can't think of a use case where you'd actually want to do this. Commented Jun 19, 2015 at 14:26
  • The initial and instance data will get passed to super(RegisterForm, self).__init__(*args, **kwargs) then the explicitly passed in values from the view (or wherever the form instance is being created) person and conference will override both initial and instance. Commented Jun 19, 2015 at 14:54
  • 4
    Read your code. You're setting self.fields['person'] to the value contained in person. self.fields['person'] was a field; person was not. Perhaps you meant self.fields['person'].initial = person? Because I can't think of any situation where you'd want to replace one of the fields of a form with a record. Commented Jun 19, 2015 at 20:38