0

I am new to Django. I would like to show some fields in the Django Admin only if a specific value has been selected on a dropdown.

For instance, I have a question model. I would like to let the user select the type of question. If it is a multiple choice question, I would like to show fields to let the user fill the possible answers.

I have found this link but it seems that it is not done for the Django Admin.

How should I proceed to achieve what I need ?

vidu.sh
  • 537
  • 1
  • 3
  • 21
  • Possible duplicate of [Django Admin Show / Hide Fields If Specific Value Is Selected In A Dropdown](https://stackoverflow.com/questions/47838059/django-admin-show-hide-fields-if-specific-value-is-selected-in-a-dropdown) – Remington Steed Sep 19 '18 at 15:51

1 Answers1

0

If the object already exists (meaning it's not a creation form) I think this could help you: ModelAdmin.get_fields().

Remington Steed
  • 109
  • 1
  • 7
Araelath
  • 575
  • 2
  • 15