开发者

Make django admin logEntry read only?

I found this post and it was very useful, but what I need is to make the logEntry mo开发者_C百科del read-only in the admin interface. Is there a way to achieve that?

Thanks!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜