2007-06-23 22:16:00 +08:00
|
|
|
"""
|
|
|
|
This is a basic model to test saving and loading boolean and date-related
|
|
|
|
types, which in the past were problematic for some database backends.
|
|
|
|
"""
|
|
|
|
|
2010-09-27 23:13:43 +08:00
|
|
|
from django.db import models
|
2007-06-23 22:16:00 +08:00
|
|
|
|
2011-10-14 02:51:33 +08:00
|
|
|
|
2007-06-23 22:16:00 +08:00
|
|
|
class Donut(models.Model):
|
2007-08-05 13:14:46 +08:00
|
|
|
name = models.CharField(max_length=100)
|
2007-06-23 22:16:00 +08:00
|
|
|
is_frosted = models.BooleanField(default=False)
|
2017-05-06 22:56:28 +08:00
|
|
|
has_sprinkles = models.BooleanField(null=True)
|
|
|
|
has_sprinkles_old = models.NullBooleanField()
|
2007-06-23 22:16:00 +08:00
|
|
|
baked_date = models.DateField(null=True)
|
|
|
|
baked_time = models.TimeField(null=True)
|
|
|
|
consumed_at = models.DateTimeField(null=True)
|
2009-03-14 03:57:00 +08:00
|
|
|
review = models.TextField()
|
2007-06-23 22:16:00 +08:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ('consumed_at',)
|
|
|
|
|
2013-11-03 12:36:09 +08:00
|
|
|
|
2010-10-09 00:14:10 +08:00
|
|
|
class RumBaba(models.Model):
|
|
|
|
baked_date = models.DateField(auto_now_add=True)
|
|
|
|
baked_timestamp = models.DateTimeField(auto_now_add=True)
|