I am using django 1.4 and I have a many2many field, so when creating the admin site I wanted to add this field as an inline, here is some code:
class SummaryInline(admin.TabularInline):
model = ParserError.summaries.through
class MyClassAdmin(admin.ModelAdmin):
list_display = ('classifier', 'name', 'err_count', 'supported')
fields = ('classifier', 'name', 'err_count', 'err_classifier', 'supported')
inlines = (SummaryInline,)
readonly_fields = ('classifier', 'err_count')
So my question is, how can I make the inline field readonly?
can_delete = False
. You can usedef has_delete_permission(self, request, obj=None): return False
instead. See docs: docs.djangoproject.com/en/2.1/ref/contrib/admin – Dialecticism