>> example, I can do:
>>
>> {% for s in objectlist %}
>>   User name is: {{s.user_name}}
>> {% endfor %}
>>
>> But, I can't do this:
>> User name is: {{ objectlist.0.user_name }}

What is "objectlist"?  is it a list() or an iterable?  It may be 
trying to index into an iterable.  Thus you can either convert it 
to a list in your view:

   return render_to_response('x.html', {'objectlist' : 
list(objectlist)})

or you can try using the iterator as it stands:

   {{ objectlist.next.user_name }}

which should find next() as a callable on your iterable and 
return the next (first) item.

-tim





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to