let me put it like this:
model.py:
class Task(models.Model):
...
seq_file = models.FileField(upload_to=\'files/\', blank=True, null=True)
...
Surprisingly but django.db.models.fields.files
does not utilize file.storage.exists()
method so I had to implement my own small function to have cross-storage compatible check for actual physical file existence:
# Check whether actual file of FileField exists (is not deleted / moved out).
def file_exists(obj):
return obj.storage.exists(obj.name)