I am making one application with 3 classes: emploee, company and department.
When I edit emploee, I need to know his company, and then have a field with all departments of the selected company. But when I use ModelChoiceField, I see all departments from all companies.
This is not a question of rest. To check the department’s field, you must be the department of the selected company. But I do not want to do validation for this, I need to show only departments from a particular company selected in the field above.
How it works on the client side, I think javascript will be needed, so I want to know if it is somehow automated in django, or if I need to download a django-plugin or jquery-plugin for this purpose.
I appreciate any help, thanks!
source
share