2009-01-29 10:46:36 +00:00
|
|
|
"""
|
2010-09-28 13:41:40 +00:00
|
|
|
Model for testing arithmetic expressions.
|
2009-01-29 10:46:36 +00:00
|
|
|
"""
|
2010-09-28 13:41:40 +00:00
|
|
|
from django.db import models
|
2009-01-29 10:46:36 +00:00
|
|
|
|
2011-10-13 18:51:33 +00:00
|
|
|
|
2009-01-29 10:46:36 +00:00
|
|
|
class Number(models.Model):
|
2009-01-30 20:02:42 +00:00
|
|
|
integer = models.IntegerField(db_column='the_integer')
|
|
|
|
float = models.FloatField(null=True, db_column='the_float')
|
2009-01-29 10:46:36 +00:00
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return u'%i, %.3f' % (self.integer, self.float)
|
|
|
|
|
2010-12-22 03:34:04 +00:00
|
|
|
class Experiment(models.Model):
|
|
|
|
name = models.CharField(max_length=24)
|
|
|
|
assigned = models.DateField()
|
|
|
|
completed = models.DateField()
|
|
|
|
start = models.DateTimeField()
|
|
|
|
end = models.DateTimeField()
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ('name',)
|
|
|
|
|
|
|
|
def duration(self):
|
|
|
|
return self.end - self.start
|
|
|
|
|