On Wed, 2007-07-11 at 06:28 +0000, Shankar wrote: > On Wed, 11 Jul 2007 11:27:59 +0800, Russell Keith-Magee wrote: [...] > > - What happens when you run the following: > > from django.contrib.auth.models import User print User.objects.all[0] > :::::::::::::: > output from python interpreter > :::::::::::::: > >>> from django.contrib.auth.models import User > >>> print User.objects.all[0] > Traceback (most recent call last): > File "<stdin>", line 1, in ? > TypeError: unsubscriptable object
To save some time here: Russell made a typo. He really wants to know the output of User.objects.all()[0] (the first element of the list of objects). Note the extra parentheses there. Regards, Malcolm -- Honk if you love peace and quiet. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---