On 7 February 2011 17:55, Sneaky Wombat <[email protected]> wrote: >> >> x = mysqlTable.objects.all() >> x.assignee >> >> doesn't work, because a list of objects doesn't have an assignee. > > clearly it was a typo on my part, no need to be nasty :) I know x is > a qs and understand its operation the way you describe it. What I > meant was if I took an element from it AFTER saving to x: > > x = mysqlTable.objects.all() > y=x[0] > y.assignee > > would always fail. Sorry to leave that out. However, if i sliced > immediately, it would work: > >> x = mysqlTable.objects.all()[0] >> x.assignee >
It's rather hard to image how assigning to "y" could change anything in this code, unless "y" is some kind of global variable. The difference in behaviour must had come from something other in your testing environment that you didn't noticed. -- Łukasz Rekucki -- 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.
