2008/6/25, Djangofan <[EMAIL PROTECTED]>:
>
>  When rendering a django template on an HTML page, I can use:
>
>  Field Name: "myFieldName" <br>
>  Value: {{ row.myFieldName }}
>
>  and it works just fine.  However, I can't find a way to make it work
>  with a dynamic variable for the field name:
>
>  Field Name: "{{ x }}"   <== where x='myFieldName'
>  Value: {{ row.x }}
>
>  Django thinks 'x' is the name of the field.  How can I tell Django
>  that 'x' is a variable, or insert that variable into the row.x?
>
>  I am sure this is an elementary solution, and I'll feel like an idiot
>  when I see the solution, but I'm tired.

You must put some code in your view, and you can put the var you want
in extra_context.


-- 
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net

SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928

Rispetta l'ambiente: se non ti è necessario, non stampare questa mail

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