Django

Code

Ticket #22 (closed: duplicate)

Opened 3 years ago

Last modified 2 years ago

[patch] FileUploadField should allow for clearing the field

Reported by: adrian Assigned to: adrian
Milestone: Component: Admin interface
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

It's currently not possible to clear the value of a FileUploadField?.

Attachments

file_del.patch (4.8 kB) - added by jlabath@gmail.com on 03/13/06 23:27:49.
Patch for admin app to allow deleting of files.

Change History

07/28/05 16:02:25 changed by wilson

  • priority changed from low to normal.

I'm setting this to normal priority - it's needed fairly often and should definitely be possible from the admin interface.

09/25/05 17:29:09 changed by jacob

  • milestone set to Version 1.0.

03/13/06 23:26:38 changed by jlabath@gmail.com

Notes for file_del.patch.

  • I guess things will have to change for this to work in magic removal branch.
  • The solution provided works for me but suggestions how to improve it are welcome.
  • Needs more testing.

03/13/06 23:27:49 changed by jlabath@gmail.com

  • attachment file_del.patch added.

Patch for admin app to allow deleting of files.

03/21/06 22:19:32 changed by anonymous

it is not working for me (with Images ) so I've change it to: ##

obj = get_object_or_404(mod, pk=object_id) try:

delete_f = getattr(obj, 'get_%s_filename' % attname) f=delete_f() os.remove(f) obj.image= obj.save()

##


of course it should be better way.

03/21/06 22:21:13 changed by anonymous

    obj = get_object_or_404(mod, pk=object_id)
    try:
        delete_f = getattr(obj, 'get_%s_filename' % attname)
        f=delete_f()
        os.remove(f)
        obj.image=''
        obj.save()

04/10/06 12:38:00 changed by anonymous

  • status changed from new to closed.
  • resolution set to fixed.

04/10/06 12:45:06 changed by adrian

  • status changed from closed to reopened.
  • resolution deleted.

Reopening because it's not fixed.

04/17/06 08:32:15 changed by russellm

  • summary changed from FileUploadField should allow for clearing the field to [patch] FileUploadField should allow for clearing the field.

06/12/06 05:44:15 changed by Go

  • type deleted.

08/09/06 22:03:53 changed by bryanchow

  • type set to defect.

08/14/06 01:53:01 changed by bryanchow

The proposed solution mentioned in my previous comment has been extended and submitted as a patch. Since the patch also addresses the problem of FileField not working properly when core=True, we've started a new ticket for it here: #2534.

11/06/06 17:08:30 changed by jacob

Closing as duplicate of #2534 (which supersedes this one).

11/06/06 22:06:48 changed by jacob

  • status changed from reopened to closed.
  • resolution set to duplicate.

01/17/07 16:12:17 changed by

  • milestone deleted.

Milestone Version 1.0 deleted


Add/Change #22 ([patch] FileUploadField should allow for clearing the field)




Change Properties
Action