Plugin DynamicModelChoiceField Filtering #9929
-
As I understand it, the DynamicModelChoiceField ties into the API to get results and build the list, but I'm not able to get this to work for the models in my Plugin. I have the base API setup and working but when I use this field class, I get no results. I have a workaround of using django.forms.ModelChoiceField, but it'd be nice if I could get DynamicModelChoiceField working. Interestingly, when I edit an existing Relationship, the form does show the Vendor correctly, but it just has the one listed. It doesn't fetch any other results so I can't change the vendor. Here's my form class:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
If you open up your dev-tools after loading the page, what does it try to connect to after you open the choice field? There should be a API query, that might give you some insight. It populates correctly when it is edited with an existing one because the data is pre-populated with that vendor. |
Beta Was this translation helpful? Give feedback.
If you open up your dev-tools after loading the page, what does it try to connect to after you open the choice field? There should be a API query, that might give you some insight.
It populates correctly when it is edited with an existing one because the data is pre-populated with that vendor.