PageRenderTime 114ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/regressiontests/comment_tests/models.py

https://code.google.com/p/mango-py/
Python | 34 lines | 21 code | 9 blank | 4 comment | 0 complexity | f878df211ae4bb085cfa57e5fca7ecf0 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. """
  2. Comments may be attached to any object. See the comment documentation for
  3. more information.
  4. """
  5. from django.db import models
  6. from django.test import TestCase
  7. class Author(models.Model):
  8. first_name = models.CharField(max_length=30)
  9. last_name = models.CharField(max_length=30)
  10. def __str__(self):
  11. return '%s %s' % (self.first_name, self.last_name)
  12. class Article(models.Model):
  13. author = models.ForeignKey(Author)
  14. headline = models.CharField(max_length=100)
  15. def __str__(self):
  16. return self.headline
  17. class Entry(models.Model):
  18. title = models.CharField(max_length=250)
  19. body = models.TextField()
  20. pub_date = models.DateField()
  21. enable_comments = models.BooleanField()
  22. def __str__(self):
  23. return self.title
  24. class Book(models.Model):
  25. dewey_decimal = models.DecimalField(primary_key = True, decimal_places=2, max_digits=5)