PageRenderTime 43ms CodeModel.GetById 34ms app.highlight 5ms RepoModel.GetById 1ms 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
 1"""
 2Tests for defer() and only().
 3"""
 4
 5from django.db import models
 6
 7
 8class Secondary(models.Model):
 9    first = models.CharField(max_length=50)
10    second = models.CharField(max_length=50)
11
12class Primary(models.Model):
13    name = models.CharField(max_length=50)
14    value = models.CharField(max_length=50)
15    related = models.ForeignKey(Secondary)
16
17    def __unicode__(self):
18        return self.name
19
20class Child(Primary):
21    pass
22
23class BigChild(Primary):
24    other = models.CharField(max_length=50)