Opened 12 years ago
Closed 12 years ago
#21744 closed Uncategorized (invalid)
Dinamic creation of forms.ImageField
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Forms | Version: | 1.6 |
| Severity: | Normal | Keywords: | django-forms |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I have a problem with the forms.ImagaField. The problem is , that I want to set initial value to this fieled dynamically , and then widget ClearableFileInput will display the "Current link" and checkbox.I read somewhere, that i have to pass "dictionary File" with attribute "url", and then the widget will know to display it. But i don't know , how pass it properly.
if attr.type == "Img":
self.fields [title] = forms.ImageField (required = bool (required))
Where here, i have to assign an initial value.
Thank you.
Please see https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels -- thanks!