I have admin view with tabular inline:
class AddressInline(admin.TabularInline):
model = Address
can_delete = False
readonly_fields = ['kind']
max_num = 3
min_num = 3
fields = (
"kind", "country", "city", "post_code", "street", "no_house"
)
def has_delete_permission(self, request, obj=None):
return False
class CustomerAdmin(admin.ModelAdmin):
fields = (
"first_name", "last_name", "pesel", "id_number", "birth_date",
"photo"
)
inlines = [AddressInline]
I want form with three other inline form. This inline form always will be tree. I hide add another button. I don't want delete inline item button in form. How can I delete or hide this button? This button can't be show to user.
May b this will help !!