Changeset 8304 for django/trunk/tests/regressiontests/bug639/models.py
- Timestamp:
- 08/11/08 10:24:46 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/regressiontests/bug639/models.py
r8244 r8304 3 3 from django.db import models 4 4 from django.core.files.storage import FileSystemStorage 5 from django.forms import ModelForm 5 6 6 7 temp_storage = FileSystemStorage(tempfile.gettempdir()) … … 9 10 title = models.CharField(max_length=30) 10 11 image = models.FileField(storage=temp_storage, upload_to='tests') 11 12 # Support code for the tests; this keeps track of how many times save() gets13 # called on each instance.12 13 # Support code for the tests; this keeps track of how many times save() 14 # gets called on each instance. 14 15 def __init__(self, *args, **kwargs): 15 16 super(Photo, self).__init__(*args, **kwargs) 16 17 self._savecount = 0 17 18 18 19 def save(self): 19 20 super(Photo, self).save() 20 21 self._savecount += 1 22 23 class PhotoForm(ModelForm): 24 class Meta: 25 model = Photo
