On Jun 11, 2008, at 7:06 AM, patS wrote:

> {{ m.z.pool }} prints: something in z
>
> but if i put {{ m.z.pool }} after {{ m.y.pool }} it will print
> something in y not something in z

This appears just like a problem that was solved in SVN trunk a couple  
weeks ago with improper caching on OneToOneFields.  Are you using  
close to the latest trunk? (r7600 or greater?)

With latest, I am unable to reproduce the error, and here is the test  
case I wrote for it:

from django.db import models

class m(models.Model):
    something = models.CharField(max_length=100)

class y(models.Model):
    m = models.OneToOneField(m,primary_key=True,related_name='y')
    pool = models.CharField(max_length=100)#example data: "something  
in y"

class z(models.Model):
    m = models.OneToOneField(m,primary_key=True,related_name='z')
    pool = models.CharField(max_length=100)#example data: "something  
in z"

__test__ = {'API_TESTS':"""
 >>> a = m.objects.create(something='123')
 >>> b = y.objects.create(m=a, pool='something in y')
 >>> c = z.objects.create(m=a, pool='something in z')
 >>> my_choice = m.objects.get(id=1)
 >>> my_choice.y.pool
u'something in y'
 >>> my_choice.z.pool
u'something in z'

"""}

Thanks,
gav

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to