vendredi 6 mars 2015

Django - How to Populate Select Data Dynamically in Admin Panel


Vote count:

0




I want to add functionality to my application that is similar to what is shown below,


Teachers - Table (Teacher | Institute): 1. Teacher 1 | ABC School 2. Teacher 2 | XYZ School


Department Table (Department | Institute): 1. Computers | ABC School 2. History | XYZ School


When I want to add a student to the system, I should be able to add him to a department in a particular school. If I use ForeignKey() then all the departments and schools are listed in drop-downs. This could lead to incorrect insertion of records. I want to dynamically load the departments after and only after the school has been selected in the admin panel. I tried many things but couldn't get it to work. I am fairly new to Django and would appreciate any help that I can get in this regard.


Thanks in Advance.



asked 32 secs ago







Django - How to Populate Select Data Dynamically in Admin Panel

Aucun commentaire:

Enregistrer un commentaire