A little InlineModelAdmin help please?

18 views
Skip to first unread message

Jeff Blaine

unread,
Mar 15, 2012, 4:32:48 PM3/15/12
to django...@googlegroups.com
Easier for me to just draw you a picture:

           +------------------------+
           |   noodle               |
           +------------------------+
                |             |
                |             |
          +-----+             +----+
          |                        |
          |                        |
+---------------+           +--------------+
| foo 1         |           | foo 2        |
|               |           |              |
| noodle ref    |           | noodle ref   |------+
+---------------+           +--------------+      |
                                   |              |
                                   |              |
                                   |              |
                            +------------+  +-----------+
                            | bar 1      |  | bar 2     |
                            |            |  |           |
                            | foo 2 ref  |  | foo 2 ref |
                            +------------+  +-----------+

I have a ModelAdmin for model "noodle" displaying an
Inline already of model "foo".  Works fine.

However, I want that existing inline of "foo" to also show
the associated info from model bar:

NOODLE
    FOO 1   foofield1    foofield2
    FOO 2   foofield1    foofield2
      BAR 1    barfield1    barfield2
      BAR 2    barfield1    barfield2

Marc Aymerich

unread,
Mar 15, 2012, 4:43:27 PM3/15/12
to django...@googlegroups.com
On Thu, Mar 15, 2012 at 9:32 PM, Jeff Blaine <cjbl...@gmail.com> wrote:
> Easier for me to just draw you a picture:
>
>            +------------------------+
>            |   noodle               |
>            +------------------------+
>                 |             |
>                 |             |
>           +-----+             +----+
>           |                        |
>           |                        |
> +---------------+           +--------------+
> | foo 1         |           | foo 2        |
> |               |           |              |
> | noodle ref    |           | noodle ref   |------+
> +---------------+           +--------------+      |
>                                    |              |
>                                    |              |
>                                    |              |
>                             +------------+  +-----------+
>                             | bar 1      |  | bar 2     |
>                             |            |  |           |
>                             | foo 2 ref  |  | foo 2 ref |
>                             +------------+  +-----------+
>
> I have a ModelAdmin for model "noodle" displaying an
> Inline already of model "foo".  Works fine.
>
> However, I want that existing inline of "foo" to also show
> the associated info from model bar:

seems that what you want is nested inlines and unfortunately there is
no solution for this in the short run, check this ticket
https://code.djangoproject.com/ticket/9025
--
Marc

Jeff Blaine

unread,
Mar 16, 2012, 9:50:19 AM3/16/12
to django...@googlegroups.com
Thanks for the reply, Marc.
Reply all
Reply to author
Forward
0 new messages