django1/tests/modeltests/known_related_objects/models.py

20 lines
462 B
Python

"""
Existing related object instance caching.
Test that queries are not redone when going back through known relations.
"""
from django.db import models
class Tournament(models.Model):
name = models.CharField(max_length=30)
class Pool(models.Model):
name = models.CharField(max_length=30)
tournament = models.ForeignKey(Tournament)
class PoolStyle(models.Model):
name = models.CharField(max_length=30)
pool = models.OneToOneField(Pool)