carljm/django-model-utils — pull request #123 by gaqzi (2014-04-10 08:37:44+00:00)
Title: Add random_filename factory for FileField

> A factory that can generate random filenames when used together with `FileField`'s `upload_to` argument.

Some storage backends doesn't handle automatic renaming of files that already exists, specifically S3. In other cases we just want to hide what the original user called the file on their device.

Because of these two reasons I've found myself writing a function like this one for several of my projects in the past and I hope it would be seen as a good addition to model_utils.

I was a bit uncertain where to put the function so I just put it in `models.py` as it is used together with models.