This code is untested, so it might need tweaking. It seems to me possible, however, that rather than define the inlines globally throughout the ModelAdmin, you can actually set them in the locally by extending the change_view function (this is the view that the admin system uses to change a specific object). It might look something like this:
class MCInline(admin.StackedInline):
model = ChallengeQuestionMC
class FBInline(admin.StackedInline):
model = ChallengeQuestionFB
class TFInline(admin.StackedInline):
model = ChallengeQuestionTF
class ORInline(admin.StackedInline):
model = ChallengeQuestionOR
class ChallengeQuestionAdmin(admin.ModelAdmin):
def change_view(self, request, object_id, form_url='', extra_context=None):
model = self.model
obj = self.get_object(request, unquote(object_id))
if obj.question_type == 'MC'
self.inlines = [MCInline]
elif obj.question_type == 'FB'
self.inlines = [FBInline]
elif obj.question_type == 'TF'
self.inlines = [TFInline]
elif obj.question_type == 'OT'
self.inlines = [ORInline]
return super(MyModelAdmin, self).change_view(request, object_id,
form_url, extra_context=extra_context)
Again, this is untested, so it very well might need some tweaking to work.