0

I am trying to figure out how to create a dependant drop down for a model formset, but all I can find is info on drop downs for forms. My models are:

Office, Staff, and Calls

Staff has a foreign key linking it to an Office, and Call has a foreign key linking it to Staff. Calls are created via csv upload, after which a user will manually select the correct staff from a drop down. However, I need this drop down to show only Staff linked to the correct Office.

I've looked at a the formset docs and a number of tutorials but am coming up short on info specific to this problem; any advice on how to approach this? Would like to avoid any JS if possible.

Matt
  • 9
  • 4

1 Answers1

0

I'm afraid this isn't possible to do server-side, you'll have to use some JS and Ajax.

Here's a nice blog post explaining how to implement this. There's also numerous questions/answers on here that may help you: one, two, and three, etc.