On Jul 20, 9:38 am, sico <[email protected]> wrote:
> Its quite simple to customize the admin template for a specific model
> by creating a change_form.html in the templates/admin/<app_name>/
> <model>/ directory.
>
> But, is it possible to refer to particular fields in the model/form
> directly?
>

> Instead of using the loops:
>    for fieldset in adminform:
>        for line in fieldset:
>            for field in line:
>  ....
>
> doing something like:
>
> {{field.first_name.label}}  {{ field.first_name.field}}<br/>
> {{field.last_name.label}}  {{ field.last_name.field}}<br/>
>



Why not? If you've got a form with fields first_name & last_name, you
may render it by hand as follows:

<div>{{ form.first_name.label_tag }}{{ form.first_name }}</div>
<div>{{ form.last_name.label_tag }}{{ form.last_name }}</div>

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