Friday, December 30, 2011

Re: no plus-sign to add related object in admin

Hi, Oleg. I've discovered the issue (for my case, anyway). It goes
beyond the field definition.

The issue is that the FK fields which have no plus sign also have no
independent admin pages. Instead, they are administered underneath
another object as inlines. I have code in "" that is
analogous to this:

class kidsInline(admin.TabularInline) :
model = kids
extra = 5

class parentsAdmin(admin.ModelAdmin) :
inlines = [kidsInline]
save_on_top = True, parentsAdmin)

Then, it's the model "kids" that I have a FK field to in another
object, and it is that FK field that has no plus sign. It makes sense
that it has no plus sign, as it has no registered, stand-alone page
for adding a new object of that type ("kids").

So, this really just changes my question. I still want users to add
and edit the child object from the parent objects' admin page --
except in the case when they need to add a new one of those child
objects from the third object's add/edit page. ... A simple way to
accomplish this might be if I could register the "kids" object with
the admin site (with say " "), but have it
NOT appear on the main "Site administration" page. I've been pouring
over the documentation and cannot see any way to do this.
"ModelAdmin" has so many options, though, that I'm still searching for
some sort of work-around.


On Dec 30, 11:32 am, Oleg Korsak <>
> Hi. Could you paste full field definition in your case? I have same
> problem and looks like I know when it doesn't have plus sign
> >> On Thu, Dec 29, 2011 at 12:58 PM, K.C. Smith <> wrote:
> >> > I've got a project where when I pull up the admin page to add an
> >> > object (an object that has several foreign keys), some of the FK
> >> > fields show the little green plus-sign links to add a new related
> >> > object for that field and other FK fields do not.
> >> > In the past, I've seen the plus-sign link to add a new related object
> >> > on all of the FK fields.  Why would it not show up?
> >> > I'm using Django 1.2.5.
> >> > K.C.

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment