1

admin.py

class ChatMessageAdmin(admin.ModelAdmin):
    def has_add_permission(self, request, obj=None):
        return False

    def has_change_permission(self, request, obj=None):
        return False

    list_display = ('username','ip', 'timestamp','message',)
    search_fields = ['message']
    list_filter = ('username','ip')

admin.site.register(ChatMessage,ChatMessageAdmin)

when I rewrite has_change_permission method like upper I can't see the http://[domain]/admin/chat page which shows all the chat entries How can I rewrite has_change_permission to have access to this page?

Edit I don't the auth_user can edit the chat entry, but if he wants I want to have the ability to delete it.

Henrik Andersson
  • 45,354
  • 16
  • 98
  • 92
Chris P
  • 2,059
  • 4
  • 34
  • 68
  • Try using `readonly_fields` without using `has_change_permission`. – arulmr Apr 15 '13 at 06:18
  • @arulmr if i do this the auth_user should see the entries detailed (change_form.html).. For some reason i don't want this :( Also i think that's not sound's as a good solution because the user will see a save button – Chris P Apr 15 '13 at 06:21
  • @arulmr i think that's what i am looking for.. http://stackoverflow.com/questions/1336382/how-can-i-modify-django-to-create-view-permission – Chris P Apr 15 '13 at 06:31

0 Answers0