I'm currently working on a django cms plugin with a model choice field dependent on another field in the change form. What i'm doing now via ajax is that, when the trigger field is selected, the dependent model choice field is updated via ajax to change the choices in the select field. However on submit, of the form, i'm encountering this error
“Select a valid choice. That is not one of the available choices.”
I did some digging in stack overflow and found a similar issue although this one is for a regular django page
Based on the link above, i should update model choice field in the form of the plugin itself depending on the value of the trigger field which i will get from request.POST
How do i go about doing this for a django cms plugin? Which method of the cms plugin should I override? I'm assuming its a method in the plugin's CMSPluginBase class but i'm not sure exactly what method to override and also how will i get the current form being used by my plugin so i could override that in the said method so that i could return my form data
Thanks