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

/tests/modeltests/defer/models.py

https://code.google.com/p/mango-py/
Python | 24 lines | 14 code | 7 blank | 3 comment | 0 complexity | 1d9d83bfb3a65259684639629878b435 MD5 | raw file
Possible License(s): BSD-3-Clause
  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)