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

/tests/regressiontests/expressions_regress/models.py

https://code.google.com/p/mango-py/
Python | 25 lines | 16 code | 6 blank | 3 comment | 0 complexity | 582f22bfee68c343c06ac755efd8af6f MD5 | raw file
 1"""
 2Model for testing arithmetic expressions.
 3"""
 4from django.db import models
 5
 6class Number(models.Model):
 7    integer = models.IntegerField(db_column='the_integer')
 8    float = models.FloatField(null=True, db_column='the_float')
 9
10    def __unicode__(self):
11        return u'%i, %.3f' % (self.integer, self.float)
12
13class Experiment(models.Model):
14    name = models.CharField(max_length=24)
15    assigned = models.DateField()
16    completed = models.DateField()
17    start = models.DateTimeField()
18    end = models.DateTimeField()
19
20    class Meta:
21        ordering = ('name',)
22
23    def duration(self):
24        return self.end - self.start
25