[Django]-Pre-fill fields in a form with data from a ForeignKey class

5👍

There is two ways to do this depending on your needs:

https://docs.djangoproject.com/en/dev/ref/forms/api/#dynamic-initial-values

Or if your form is a ModelForm you can use the instance parameter:

https://docs.djangoproject.com/en/1.4/topics/forms/modelforms/

👤Kevin

Leave a comment