Q:

Django Admin Inline an object

I have Two models Question and QuestionChoice. QuestionChoice has a ForeignKeyfield which points to Question. I would like to have these as inline stack views in the admin view but I'm getting an error.
Models:
class Question(models.Model):
    PROFILE = 0
    EVENT_REPORT = 1
    UNIVERSITY_REPORT = 2
    USER_REPORT = 3
    TYPE_LIST = [PROFILE, EVENT_REPORT, UNIVERSITY_REPORT, USER_REPORT]
    TYPE_CHOICES = (
        (PROFILE, 'Profile'),
        (EVENT_REPORT, 'Event Report'),
        (UNIVERSITY_REPORT, 'University Report'),
        (USER_REPORT, 'User Report'),
    )
    description = models.CharField(max_length=100)
    type =models.IntegerField(choices=TYPE_CHOICES, default=PROFILE)

    def __str__(self):
        return self.description

class QuestionChoice(models.Model):
    description = models.CharField(max_length=100)
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    answer = models.CharField(max_length=100, blank=True)

    def __str__(self):
        return self.question.first().description + ' ' + self.description

Admin:
admin.site.register(QuestionChoice)
class QuestionChoiceInline(admin.StackedInline):
    model = QuestionChoice
    can_delete = True
    verbose_name_plural = 'Question Choices'
    fk_name = "question"

class CustomQuestionAdmin(UserAdmin):
    inlines = (QuestionChoiceInline, )

    def get_inline_instances(self, request, obj=None):
        if not obj:
            return list()
        return super(CustomQuestionAdmin, self).get_inline_instances(request, obj)

admin.site.register(Question, CustomQuestionAdmin)

But I'm getting this error:
ERRORS:
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E019) The value of 'filter_horizontal[0]' refers to 'groups', which is not an attribute of 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E019) The value of 'filter_horizontal[1]' refers to 'user_permissions', which is not an attribute of 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E033) The value of 'ordering[0]' refers to 'username', which is not an attribute of 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E108) The value of 'list_display[0]' refers to 'username', which is not a callable, an attribute of 'CustomQuestionAdmin', or an attribute or method on 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E108) The value of 'list_display[1]' refers to 'email', which is not a callable, an attribute of 'CustomQuestionAdmin', or an attribute or method on 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E108) The value of 'list_display[2]' refers to 'first_name', which is not a callable, an attribute of 'CustomQuestionAdmin', or an attribute or method on 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E108) The value of 'list_display[3]' refers to 'last_name', which is not a callable, an attribute of 'CustomQuestionAdmin', or an attribute or method on 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E108) The value of 'list_display[4]' refers to 'is_staff', which is not a callable, an attribute of 'CustomQuestionAdmin', or an attribute or method on 'userprofile.Question'.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E116) The value of 'list_filter[0]' refers to 'is_staff', which does not refer to a Field.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E116) The value of 'list_filter[1]' refers to 'is_superuser', which does not refer to a Field.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E116) The value of 'list_filter[2]' refers to 'is_active', which does not refer to a Field.
<class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E116) The value of 'list_filter[3]' refers to 'groups', which does not refer to a Field.

Any ideas what I'm doing wrong? 

A:

You can simply write it this way:     
class QuestionChoiceInline(admin.StackedInline):
    model = QuestionChoice

class CustomQuestionAdmin(admin.ModelAdmin):
    list_display = ['PROFILE', ------]
    inlines = [QuestionChoiceInline, ]
    class Meta:
        model = Question

admin.site.register(Question, CustomQuestionAdmin)

