On Tue, 2009-01-27 at 14:48 -0800, Rodrigo C. wrote:
> > This isn't a Django issue. It's a standard property of browsers: you
> > can't set an initial value for file input fields. This is a security
> > measure, to stop malicious pages uploading files from your hard drive
> > without your explicit instruction.
> 
> I see. If there's no way to set the initial value for the field, would
> there be some way to make Django not return an error when the user
> tries to save the field without re-uploading the file? And maybe
> display the current value so the user knows it's already uploaded (as
> the admin site does)?

This depends on how you're using the formset. In order not to raise an
error, the form field involved has to know that there is a previous
value and what it is. The standard FileField form field already does
that (if no data is submitted and the "initial" value on the field is
set, it passes validation).

Displaying the initial value for file fields is something that has to be
done manually in form display, from memory.

So, perhaps you could give a small, reduced to the minimum, example of
how you're setting all this up. Maybe it's a problem in inline formsets,
or maybe it's an oversight in your code. At the moment, hard to tell.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to