>
> A little weird, maybe someone else can explain exactly what's going
> on. Presumably a QuerySet slice is somehow not being treated as the
> object itself.

Hi,

As Eric correctly pointed out that slicing a QuerySet is not "sticky".
Whenever you take a slice of an exisiting QuerySet, Django clones it
dynamically to a new QuerySet. So every time you reference m[0] you
get a slice from a *clone* of the QuerySet m. It follows that this
clone has a different instance of m[0] from the previous m[0].

As Eric suggested, save m[0] first to a variable if you need to act on
a known single instance of that object for multiple operations.

-Rajesh D

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

Reply via email to