Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8473 closed (invalid)

Admin interface fieldset fields do not have a url property

Reported by: Seamus Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: admin, interface, fieldset, fields, field, url, path, property, method
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've been doing some django admin template hacking and I've run into some peculiar behavior in fieldset.html . From viewing this file you can see that a fieldset is a collection of arbitrary fields. These particular fields do not behave as documented; I'm trying to access a url or path property for an image field but they don't seem to exist. Is there any other way to retrieve this data from the field or can anyone make a patch to include these properties before the 1.0 release? These fields were available before the introduction of newforms-admin.

-Seamus

Change History (4)

comment:1 by Collin Grady, 16 years ago

it looks like you can access the url from a form widget, based on how the AdminFileWidget works, but you'd have to specify that in your form for admin, you can't just do it from the template anymore

comment:2 by Brian Rosner, 16 years ago

Resolution: invalid
Status: newclosed

The fields that you are seeing in the templates are not regular form fields. The admin wraps them in helper classes to provide additional functionality. You can access the form field with {{ field.field }} for example.

comment:3 by Brian Rosner, 16 years ago

While this is still invalid, I wanted to clarify that to access url and/or path of the underlying data since that is dealt with by the value passed to the render method of the widget. You likely need to just subclass your own widget to get a hold that data.

comment:4 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top