2

I found this post and it was very useful, but what I need is to make the logEntry model read-only in the admin interface. Is there a way to achieve that?

Thanks!

eos87
  • 8,961
  • 12
  • 49
  • 77

1 Answers1

2

Here is the example from the post you mentioned, with the needed change to make the fields read-only:

from django.contrib.admin.models import LogEntry

class LogEntryAdmin(admin.ModelAdmin):
    readonly_fields = ('content_type', 'user', 'action_time')

admin.site.register(LogEntry, LogEntryAdmin)

This works only in Django 1.2 so it is possible you will have to upgrade your Django package.

Adam
  • 851
  • 6
  • 10