简体   繁体   中英

Django Admin add edit/create buttons to Parent

I'm trying to add an add and edit link to my Django admin for the ForeignKey field category. I already have this on the schedule field, however this is handled by djcelery and i cannot figure out how they do this:

在此处输入图片说明

My categories field currently looks like this:

在此处输入图片说明

Both fields are simply added to the admin screen through a foreign key relation.

Is there any default settings for this in Django admin?

Facepalm! I got the desiredresult once i added a admin for categories:

admin.site.register(Category)

在此处输入图片说明

However, if any one know how to hide the Categories list from the main admin screen, please update my answer.

在此处输入图片说明

(Would also want to hide 'Categories' from this menu)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM