I'm not sure but try {{ original }} ...here is the code:

http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py

    context = {
860                 'title': _('Change %s') % force_unicode
(opts.verbose_name),
861                 'adminform': adminForm,
862                 'object_id': object_id,
863                 'original': obj,
864                 'is_popup': request.REQUEST.has_key('_popup'),
865                 'media': mark_safe(media),
866                 'inline_admin_formsets': inline_admin_formsets,
867                 'errors': helpers.AdminErrorList(form, formsets),
868                 'root_path': self.admin_site.root_path,
869                 'app_label': opts.app_label,
870             }

On Jul 14, 5:37 am, janedenone <janeden...@googlemail.com> wrote:
> On Jul 13, 10:05 pm, janedenone <janeden...@googlemail.com> wrote:
>
>
>
>
>
> > On Jul 13, 6:07 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
>
> > > On Jul 13, 4:02 pm, janedenone <janeden...@googlemail.com> wrote:
>
> > > > Hi,
>
> > > > I read the documentation on customizing admin templates, but I still
> > > > wonder how to access the object attributes in the change_form.html. I
> > > > am capable of getting the id using {{ object_id }}:
>
> > > > {% if change %}{% if not is_popup %}
> > > >   <ul class="object-tools">
> > > >     <li><a href="/booking/{{ object_id }}/view_calculation"
> > > > class="historylink">{% trans "View Calculation" %}</a></li>
> > > > ...
>
> > > > but I need to access a couple of other attributes. {{ object_name }}
> > > > does not work, nor does {{ object_cottage_name}} for getting a related
> > > > object's name.
>
> > > > Thankful for any hint.
>
> > > > - Jan
>
> > > The syntax for looking up attributes - in templates just like in
> > > Python - is a dot, not an underscore. So you should use object.name,
> > > etc.
>
> > Many thanks, but that does not work either.
>
> > - Jan
>
> PS. I was using {{ object_id }} because this worked in the
> object_tools block. "object" does not seem to be the object modified
> via change_form.html, though.
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to