views:

63

answers:

0

I'm developing a questionnaire app. The question model has a "type" field, lets say A and B. The "question" model is set as foreign key to two other models, ModelA and ModelB.
Its easy enough to add ModelA(or ModelB) as inlines for questionadmin.
But I want to dynamically change the inline fields which are shown on admin page, depending on the radio button selection of question as type A or B.
So I'm thinking of using InlineModelAdmin.formset to dynamically pick ModelA or ModelB. The second approach could be to override admin template and user jquery/ajax to show form related to ModelA or ModelB.
Which approach would be better? Btw, its just over a month since I've been working with django, so if there is some popular approach that I'm missing, please let met know.