models.py 566 B

12345678910111213141516171819202122232425262728
  1. """
  2. Tests for defer() and only().
  3. """
  4. from django.db import models
  5. class Secondary(models.Model):
  6. first = models.CharField(max_length=50)
  7. second = models.CharField(max_length=50)
  8. class Primary(models.Model):
  9. name = models.CharField(max_length=50)
  10. value = models.CharField(max_length=50)
  11. related = models.ForeignKey(Secondary)
  12. def __unicode__(self):
  13. return self.name
  14. class Child(Primary):
  15. pass
  16. class BigChild(Primary):
  17. other = models.CharField(max_length=50)
  18. class ChildProxy(Child):
  19. class Meta:
  20. proxy=True