mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	When &'ing or |'ing querysets, wrong values could be cached, and crashes
could happen.
Thanks Marc Tamlyn for figuring out the problem and writing the patch.
Backport of 07fbc6a.
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			582 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			582 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 Organiser(models.Model):
 | |
|     name = models.CharField(max_length=30)
 | |
| 
 | |
| class Pool(models.Model):
 | |
|     name = models.CharField(max_length=30)
 | |
|     tournament = models.ForeignKey(Tournament)
 | |
|     organiser = models.ForeignKey(Organiser)
 | |
| 
 | |
| class PoolStyle(models.Model):
 | |
|     name = models.CharField(max_length=30)
 | |
|     pool = models.OneToOneField(Pool)
 | |
| 
 |