Django

Code

Show
Ignore:
Timestamp:
08/11/08 10:24:46 (4 months ago)
Author:
gwilson
Message:

Refs #7742 -- Got bug639 regression tests using newforms instead of oldforms.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/bug639/models.py

    r8244 r8304  
    33from django.db import models 
    44from django.core.files.storage import FileSystemStorage 
     5from django.forms import ModelForm 
    56 
    67temp_storage = FileSystemStorage(tempfile.gettempdir()) 
     
    910    title = models.CharField(max_length=30) 
    1011    image = models.FileField(storage=temp_storage, upload_to='tests') 
    11      
    12     # Support code for the tests; this keeps track of how many times save() gets 
    13     # 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. 
    1415    def __init__(self, *args, **kwargs): 
    1516        super(Photo, self).__init__(*args, **kwargs) 
    1617        self._savecount = 0 
    17      
     18 
    1819    def save(self): 
    1920        super(Photo, self).save() 
    2021        self._savecount += 1 
     22 
     23class PhotoForm(ModelForm): 
     24    class Meta: 
     25        model = Photo