mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
7899568e01
This is a backwards-incompatible change; consult BackwardsIncompatibleChanges for details. Fixes #3567, #3621, #4345, #5361, #5655, #7415. Many thanks to Marty Alchin who did the vast majority of this work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
11 lines
339 B
Python
11 lines
339 B
Python
import tempfile
|
|
import os
|
|
from django.db import models
|
|
from django.core.files.storage import FileSystemStorage
|
|
|
|
temp_storage = FileSystemStorage(tempfile.mkdtemp())
|
|
UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload')
|
|
|
|
class FileModel(models.Model):
|
|
testfile = models.FileField(storage=temp_storage, upload_to='test_upload')
|