2009-03-19 09:06:04 +00:00
|
|
|
"""
|
|
|
|
Tests for defer() and only().
|
|
|
|
"""
|
|
|
|
|
|
|
|
from django.db import models
|
2010-09-12 20:03:20 +00:00
|
|
|
|
2009-03-19 09:06:04 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2009-03-19 22:46:28 +00:00
|
|
|
def __unicode__(self):
|
|
|
|
return self.name
|
|
|
|
|
2009-06-06 06:14:05 +00:00
|
|
|
class Child(Primary):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class BigChild(Primary):
|
|
|
|
other = models.CharField(max_length=50)
|