Opened 10 years ago

Closed 10 years ago

#21744 closed Uncategorized (invalid)

Dinamic creation of forms.ImageField

Reported by: jenyapri@… 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.

Change History (1)

comment:1 by Tim Graham, 10 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top