mortenbagai wrote: > Hello, > > I have two model objects, Section and Page. Each Page is mapped to a > Section through a regular ForeignKey field. On the Section edit detail > display in the Django admin app, I'd like to list the Page objects > belonging to that Section and having a few fields be editable from > there. > > However, it seems to me that there is no way to control which fields > are displayed when editing an object inline through its ForeignKey > relation. At first, I thought only fields marked core=True would be > displayed, but that does not seem to be the case. In fact, going > through the docs I couldn't find a way to achieve my goal, so I am > wondering if this is currently supported at all? > > If not, I think it would be a useful feature addition to be able to do > this. > > Thanks, > > Morten > >
This is not currently doable, AFAIK. You may be able to hide the fields by judicious use of CSS ( display: none). However, the patch I have been making to clean up the admin and metasystem, on ticket #535, includes a feature that may help. Rather than doing edit_inline=meta.TABULAR or meta.STACKED, it is also possible to do edit_inline="path/to/template" (TABULAR and STACKED are redefined to point at included templates) . This template could simply not show the fields you don't want. You can also control the layout of the inline objects, I've been attempting to make a horizontal scroller one without resorting to tables ;-) Anyway, it is a work in progress, and not documented. It will NOT work without applying the patch at http://code.djangoproject.com/ticket/535/, and there is no guarantee that this patch will be applied any time soon or in its current form.