> On Jun 6, 2006, at 11:03 AM, Adrian Holovaty wrote:
>
>>
>> On 6/6/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
>>> Here's the problem: How do I get to those in a template? I know
>>> there's only one UserInfo object per User object, and ideally I'd
>>> like to type something like
>>>
>>> {{ user.userinfo.formalName }}
>>>
>>> in the template, but this doesn't work because userinfo is actually
>>> userinfo_set and I'd need to get the first element of that. I don't
>>> think that's possible in the templating language, but I'd be  
>>> happy to
>>> be wrong.
>>
>> Get happy! :)
>>
>> {{ user.userinfo_set.0.formalName }}
>>

Has something changed recently? I thought this worked, but I'm  
getting an unindexable object error now.

I think using

{{ user.userinfo_set.all.0.formalName }}

solves the problem, but I'm wondering if something changed that I  
should be aware of.

Todd


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to