Everybody knows the default django FileField doesn't allow to remove an
existing file...

This is a good replacement. Just use RemovableFileField instead of
FileField in your models:
http://djangosnippets.org/snippets/636/


I want to implement on it another feature- When there is a file being
uploaded, but the form fails validation for other reason, I want to keep
the file in the server, so no need to upload the file again. The next
time the form is submit I would take the file and save it in the model.


BUT this is not possible because there is (apparently) no way to acess
the request object inside RemovableFileField nor from the widget...

SO I think I have to implement this in the ModelForm, or in the
ModelAdmin, which is a more ugly solution.
(any ideas???)


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to