How to configure django inline. My admin.py setting is below.
class ChildModelInline(admin.TabularInline):
model = ChildModel
can_delete = True
@admin.register(ParentModel)
class ParentModelAdmin(admin.ModelAdmin):
inlines = [ChildModelInline,]
ChildModel is associated with ParentModel using the models.ForeignKey field. I would like to be able to select multiple child objects in the ParentModel inline form to delete, but not remove the child from the database, just delete the ForeignKey relationship in the child.
Thank!
source
share