Updated FileField / ImageField with a delete checkbox
Example model: class MyModel(models.Model): file = RemovableFileField(upload_to='files', \ null=True, blank=True) image = RemovableImageField(upload_to='images', \ null=True, blank=True) A delete checkbox will be automatically rendered when using ModelForm or editing it using form_for_instance. Also, the filename or the image will be displayed below the form field. You can edit the render method of the DeleteCheckboxWidget or add one to RemovableFileFormWidget to customize the rendering. UPDATE: 5. April 2009. Making it work with latest Django (thanks for the comments).
- newforms
- models
- imagefield
- filefield
- remove
- delete