parts/django/tests/regressiontests/file_uploads/models.py
changeset 307 c6bca38c1cbf
equal deleted inserted replaced
306:5ff1fc726848 307:c6bca38c1cbf
       
     1 import tempfile
       
     2 import os
       
     3 from django.db import models
       
     4 from django.core.files.storage import FileSystemStorage
       
     5 
       
     6 temp_storage = FileSystemStorage(tempfile.mkdtemp())
       
     7 UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload')
       
     8 
       
     9 class FileModel(models.Model):
       
    10     testfile = models.FileField(storage=temp_storage, upload_to='test_upload')