from django.contrib import admin
from .models import Message


class MessageAdmin(admin.ModelAdmin):
    list_display = ('text', 'msisdn', 'datetime', 'status')
    list_filter = ('status',)
    # list_display_links = None
    actions = ['mark_as_accepted', 'mark_as_rejected']
    date_hierarchy = 'datetime'
    readonly_fields = ('text', 'msisdn', 'datetime')

    def mark_as_accepted(self, request, queryset):
        queryset.update(status=Message.ACCEPTED)
    mark_as_accepted.short_description = 'Accept selected messages'

    def mark_as_rejected(self, request, queryset):
        queryset.update(status=Message.REJECTED)
    mark_as_rejected.short_description = 'Reject selected messages'

    def has_add_permission(self, request):
        return False

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


admin.site.disable_action('delete_selected')
admin.site.register(Message, MessageAdmin)

@@ -53,16 +53,26 @@
  Message
+, Question
 %0A%0A%0Aclass
@@ -198,40 +198,8 @@
 ',)%0A
-    # list_display_links = None%0A
     
@@ -905,8 +905,134 @@
 eAdmin)%0A
+%0A%0Aclass QuestionAdmin(admin.ModelAdmin):%0A    list_display = ('text', 'created')%0A%0Aadmin.site.register(Question, QuestionAdmin)%0A

Allow SMS questions to be managed through the admin