2008-07-20 12:44:41 +00:00
|
|
|
import tempfile
|
|
|
|
import os
|
|
|
|
from django.db import models
|
2008-08-08 20:59:02 +00:00
|
|
|
from django.core.files.storage import FileSystemStorage
|
2008-07-20 12:44:41 +00:00
|
|
|
|
2008-08-08 20:59:02 +00:00
|
|
|
temp_storage = FileSystemStorage(tempfile.mkdtemp())
|
|
|
|
UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload')
|
2008-07-20 12:44:41 +00:00
|
|
|
|
|
|
|
class FileModel(models.Model):
|
2008-08-08 20:59:02 +00:00
|
|
|
testfile = models.FileField(storage=temp_storage, upload_to='test_upload')
|