Created
March 28, 2020 12:07
-
-
Save z4none/77485e7d5efa14eabfe5ac6f3e1b657a to your computer and use it in GitHub Desktop.
view django models.LogEntry in admin, disable create / edit / delete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LogEntryAdmin(admin.ModelAdmin): | |
| list_display = ('action_time', 'user', 'object_repr', 'action_flag') | |
| list_per_page = 20 | |
| list_display_links = None | |
| search_fields = ['=user__username', ] | |
| fieldsets = [(None, {'fields': ()}), ] | |
| def has_add_permission(self, request): | |
| return False | |
| def has_delete_permission(self, request, obj=None): | |
| return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment