Opened 19 years ago

Closed 17 years ago

#871 closed defect (worksforme)

ImageField doesn''t honor blank=True argument

Reported by: flavio.curella@… Owned by: Adrian Holovaty
Component: contrib.admin Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

with this code:

class File(meta.Model):
        file = meta.FileField(upload_to=MEDIA_ROOT, core=True)
        thumbnail = meta.ImageField(upload_to="/files/thumbs/", null=True, blank=True)

adding a File requires also a thumbnail.

Change History (5)

comment:1 by Seer, 19 years ago

Summary: ImageField doesn't honor blank=True argumentImageField doesn''t honor blank=True argument

Hi all
im fine, gl all!

comment:2 by Simon G. <dev@…>, 18 years ago

Resolution: worksforme
Status: newclosed

Marking as worksforme as I'm unable to replicate this. If you (or anyone else) is still having problems with this, please reopen the ticket and let us know.

comment:3 by anonymous, 17 years ago

Resolution: worksforme
Status: closedreopened

doesnt work for me. :-(

picture = models.ImageField(upload_to=settings.UPLOAD_TO, blank=True, null=True)

returns:

Enter a valid filename.

comment:4 by John Shaffer <jshaffer2112@…>, 17 years ago

These models all work perfectly for me with [5722]. I couldn't find any circumstances where they would require the ImageField to be non-blank.

class Picture(models.Model):
    title = models.CharField(maxlength=40)
    image = models.ImageField(upload_to='images/', null=True, blank=True)

class PictureB(models.Model):
    image = models.ImageField(upload_to='images/', null=True, blank=True)

class FileWithPicture(models.Model):
    file = models.FileField(upload_to='files/')
    image = models.ImageField(upload_to='images/', null=True, blank=True)

class ImageFK(models.Model):
    fk = models.ForeignKey(FileWithPicture, edit_inline=models.STACKED)
    title = models.CharField(maxlength=40, core=True)
    file = models.FileField(upload_to='files/')
    image = models.ImageField(upload_to='images/', null=True, blank=True)

comment:5 by Chris Beaven, 17 years ago

Resolution: worksforme
Status: reopenedclosed

Closing based on John's "worksforme"

Note: See TracTickets for help on using tickets.
Back to Top