/tests/modeltests/defer/models.py
Python | 24 lines | 14 code | 7 blank | 3 comment | 0 complexity | 1d9d83bfb3a65259684639629878b435 MD5 | raw file
Possible License(s): BSD-3-Clause
- """
- Tests for defer() and only().
- """
- from django.db import models
- class Secondary(models.Model):
- first = models.CharField(max_length=50)
- second = models.CharField(max_length=50)
- class Primary(models.Model):
- name = models.CharField(max_length=50)
- value = models.CharField(max_length=50)
- related = models.ForeignKey(Secondary)
- def __unicode__(self):
- return self.name
- class Child(Primary):
- pass
- class BigChild(Primary):
- other = models.CharField(max_length=50)