from django.contrib import admin

from us_ignite.challenges.models import Challenge, Entry, Question


class QuestionInlineAdmin(admin.TabularInline):
    model = Question
    extra = 5


class ChallengeAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug', 'status', 'start_datetime', 'end_datetime')
    search_fields = ('name', 'slug', 'summary', 'description')
    list_filter = ('status', 'start_datetime', 'end_datetime')
    date_hierarchy = 'start_datetime'
    inlines = [QuestionInlineAdmin]


class EntryAdmin(admin.ModelAdmin):
    list_display = ('challenge', 'application', 'status', 'created', 'modified')
    list_filter = ('challenge__name', 'status')
    date_hierarchy = 'created'
    raw_id_fields = ('application', )


admin.site.register(Challenge, ChallengeAdmin)
admin.site.register(Entry, EntryAdmin)

@@ -84,16 +84,29 @@
 , Entry,
+ EntryAnswer,
  Questio
@@ -516,16 +516,109 @@
 dmin%5D%0A%0A%0A
+class EntryAnswerAdminInstance(admin.TabularInline):%0A    extra = 0%0A    model = EntryAnswer%0A%0A%0A
 class En
@@ -843,16 +843,59 @@
 ion', )%0A
+    inlines = %5BEntryAnswerAdminInstance, %5D%0A
 %0A%0Aadmin.

Add admin support for moderate the ``Entry`` and view the entry answers.