PageRenderTime 35ms CodeModel.GetById 14ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause
  1. """
  2. This is a basic model to test saving and loading boolean and date-related
  3. types, which in the past were problematic for some database backends.
  4. """
  5. from django.db import models
  6. class Donut(models.Model):
  7. name = models.CharField(max_length=100)
  8. is_frosted = models.BooleanField(default=False)
  9. has_sprinkles = models.NullBooleanField()
  10. baked_date = models.DateField(null=True)
  11. baked_time = models.TimeField(null=True)
  12. consumed_at = models.DateTimeField(null=True)
  13. review = models.TextField()
  14. class Meta:
  15. ordering = ('consumed_at',)
  16. def __str__(self):
  17. return self.name
  18. class RumBaba(models.Model):
  19. baked_date = models.DateField(auto_now_add=True)
  20. baked_timestamp = models.DateTimeField(auto_now_add=True)