[Answered ]-How do you hide Django model fields with foreign keys?

1👍

You can use the Model.Admin exclude and readonly_fields attributes. See documentation here and here.

For example:

class SeminarAdmin(admin.ModelAdmin):
    model = Seminar
    inlines = (PageInline,)
    list_display = ('seminar_name', 'is_active')
    def get_ordering(self, request):
        return ['seminar_name']

    exclude = ('seminar_name',)
    readonly_fields = ('is_active',)
👤yagus

Leave a comment