thirdparty/google_appengine/lib/django/tests/regressiontests/bug639/models.py
changeset 2878 cf4b80992451
parent 2871 e440e94a874b
parent 2877 8bbdc95f87f8
child 2879 cb0f9b4646aa
equal deleted inserted replaced
2871:e440e94a874b 2878:cf4b80992451
     1 import tempfile
       
     2 from django.db import models
       
     3 
       
     4 class Photo(models.Model):
       
     5     title = models.CharField(maxlength=30)
       
     6     image = models.FileField(upload_to=tempfile.gettempdir())
       
     7     
       
     8     # Support code for the tests; this keeps track of how many times save() gets
       
     9     # called on each instance.
       
    10     def __init__(self, *args, **kwargs):
       
    11        super(Photo, self).__init__(*args, **kwargs)
       
    12        self._savecount = 0
       
    13     
       
    14     def save(self):
       
    15         super(Photo, self).save()
       
    16         self._savecount +=1