Opened 10 years ago

Closed 10 years ago

Last modified 7 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: master
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: UI/UX:


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.


Change History (4)

comment:1 Changed 10 years ago by Collin Grady

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 Changed 10 years ago by Brian Rosner

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 Changed 10 years ago by Brian Rosner

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 Changed 7 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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