[Django]-Django admin inline with only one form without add another option

5👍

Instead of using ForeignKey, use OneToOneField and it will display just one item without the add another link.

1👍

if you want only 1 inline can be added. You can use max_num option.

class MyModelInline(admin.TabularInline):
    model = MyModel
    extra = 0
    max_num = 1
👤Doni

Leave a comment