Thursday, 21 July 2016

Django: FileField name special chars replaced automatically

My model:

class MyFile(models.Model):
    file = models.FileField(upload_to="myfiles", max_length=500)
    slug = models.SlugField(max_length=500, blank=True)

When file names contain special chars, such as ' '(space), special chars will be replaced by underscore automatically. Where (in which function) does this happen? How to disable this automatic validation?

Thanks Thanks



from Recent Questions - Stack Overflow http://ift.tt/29OtlLx
via https://ifttt.com/ IFTTT

No comments:

Post a Comment