PageRenderTime 460ms CodeModel.GetById 219ms app.highlight 3ms RepoModel.GetById 169ms app.codeStats 0ms

/tests/regressiontests/datatypes/models.py

https://code.google.com/p/mango-py/
Python | 25 lines | 16 code | 5 blank | 4 comment | 0 complexity | a5414b0ba41457f4ad6ad1b6d7b3bed8 MD5 | raw file
 1"""
 2This is a basic model to test saving and loading boolean and date-related
 3types, which in the past were problematic for some database backends.
 4"""
 5
 6from django.db import models
 7
 8class Donut(models.Model):
 9    name = models.CharField(max_length=100)
10    is_frosted = models.BooleanField(default=False)
11    has_sprinkles = models.NullBooleanField()
12    baked_date = models.DateField(null=True)
13    baked_time = models.TimeField(null=True)
14    consumed_at = models.DateTimeField(null=True)
15    review = models.TextField()
16
17    class Meta:
18        ordering = ('consumed_at',)
19
20    def __str__(self):
21        return self.name
22
23class RumBaba(models.Model):
24    baked_date = models.DateField(auto_now_add=True)
25    baked_timestamp = models.DateTimeField(auto_now_add=True)