PageRenderTime 9ms CodeModel.GetById 5ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/regressiontests/cache/models.py

https://code.google.com/p/mango-py/
Python | 11 lines | 9 code | 2 blank | 0 comment | 0 complexity | e3eca1fa7e375fd3fdd82f69c4214b56 MD5 | raw file
 1from django.db import models
 2from datetime import datetime
 3
 4def expensive_calculation():
 5    expensive_calculation.num_runs += 1
 6    return datetime.now()
 7
 8class Poll(models.Model):
 9    question = models.CharField(max_length=200)
10    answer = models.CharField(max_length=200)
11    pub_date = models.DateTimeField('date published', default=expensive_calculation)