#10179: admin broken on FileField with blank=True --------------------------------------+------------------------------------- Reporter: malte | Owner: nobody Status: new | Milestone: Component: django-admin.py | Version: 1.0 Resolution: | Keywords: admin filefield bug Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | --------------------------------------+------------------------------------- Old description:
> If you have a FileField declared like so: > image_1 = models.FileField(upload_to=get_image_path, null=True, > blank=True) > > Then in django admin, the field becomes voluntary as it should. If you > save a file in an optional field that works as expected. But if you come > back to the item in the admin, and just hit 'save' without touching the > optional file that is uploaded, the db record gets updated with a blank > value for the FileField, effectively killing the connection with the > file. > > I'm using Sqlite, may make a difference here I suppose. New description: If you have a FileField declared like so: {{{ image_1 = models.FileField(upload_to=get_image_path, null=True, blank=True) }}} Then in django admin, the field becomes voluntary as it should. If you save a file in an optional field that works as expected. But if you come back to the item in the admin, and just hit 'save' without touching the optional file that is uploaded, the db record gets updated with a blank value for the FileField, effectively killing the connection with the file. I'm using Sqlite, may make a difference here I suppose. Comment (by ramiro): (reformatted description) malte: What version of Django are you using? If youa re using a revision from trunk latter that r9766, can you please try with r9765 and report back? -- Ticket URL: <http://code.djangoproject.com/ticket/10179#comment:2> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---