PageRenderTime 202ms CodeModel.GetById 100ms app.highlight 2ms RepoModel.GetById 99ms app.codeStats 0ms

/tests/regressiontests/file_uploads/models.py

https://code.google.com/p/mango-py/
Python | 10 lines | 8 code | 2 blank | 0 comment | 0 complexity | 00a7baca920a2e39b4d8aafdf23efd0b MD5 | raw file
 1import tempfile
 2import os
 3from django.db import models
 4from django.core.files.storage import FileSystemStorage
 5
 6temp_storage = FileSystemStorage(tempfile.mkdtemp())
 7UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload')
 8
 9class FileModel(models.Model):
10    testfile = models.FileField(storage=temp_storage, upload_to='test_upload')