from django.contrib import admin

# Register your models here.
from .models import Channel, Question, Response


@admin.register(Channel)
class ChannelAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')


class QuestionResponses(admin.StackedInline):
    model = Response
    extra = 1
    # max_num = 0


@admin.register(Question)
class QuestionAdmin(admin.ModelAdmin):
    list_display = ('title', 'inactive', 'channel',
                    'author', 'pub_date', 'mod_date')
    #list_filter = ('uuid',)
    inlines = [QuestionResponses]


@admin.register(Response)
class ResponseAdmin(admin.ModelAdmin):
    list_display = ('question', 'author', 'pub_date')
