mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[soc2009/multidb] Merged up to trunk r11756.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11758 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
11
tests/regressiontests/cache/models.py
vendored
11
tests/regressiontests/cache/models.py
vendored
@@ -0,0 +1,11 @@
|
||||
from django.db import models
|
||||
from datetime import datetime
|
||||
|
||||
def expensive_calculation():
|
||||
expensive_calculation.num_runs += 1
|
||||
return datetime.now()
|
||||
|
||||
class Poll(models.Model):
|
||||
question = models.CharField(max_length=200)
|
||||
answer = models.CharField(max_length=200)
|
||||
pub_date = models.DateTimeField('date published', default=expensive_calculation)
|
||||
|
||||
Reference in New Issue
Block a user