Open senorpinatta opened 3 years ago
Further review leads me to believe that approach 1 is incorrect.
Further inspection also shows the difference between the urls in the responses.
To operate successfully, the response url would be: "../admin/sites/site/add/.." or something along those lines.
The issue is that it is using "../api/paginated/sites.../" instead. So this is probably less an DACL issue, and more of my own django/url configuration issue.. I'll post the solution if/when I have one.
Expected Behavior Form option only displays values related to previously selected option in form.
Successfully tested using the linkedurls test package. The network listener showed the following message displaying a valid response_.
Actual Behaviour The following error message is displayed when trying to link the list of available options to a previously selected value in the form. .
I used two different approaches but got this error.
Using autocomplete.ModelSelect2(url='sites/site/add/', forward=...) and the following is what the network listener recorded. Response field seems to send the whole page's html.
Using autocomplete.ModelSelect2(url='site-list', forward=...) and the following is what the network listener recorded. "site-list" was chosen for being one of the possible urls show from
print(router.get_urls())
. Response field displays null values.Relevant code snippets:
views.py
form.py
urls.py
admin.py
Between the two errors (1,2 using different url addresses for the autocomplete.ModelSelect2 function) I'm hoping someone can point out my implementation error or verify if this is a bug. The demo package seems to have configured the urls using django's url_patterns, whereas my preexisting project uses rest_framework's router library, maybe the conflict lies there.