jazzband / django-smart-selects

chained and grouped selects for django forms
https://django-smart-selects.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.1k stars 348 forks source link

chainedforeignkeyfeild don't render any values #262

Closed ofathy closed 3 years ago

ofathy commented 6 years ago

You MUST use this template when reporting issues. Please make sure you follow the checklist and fill in all of the information sections below.


All versions of django-smart-selects prior to version 1.2.8 are vulnerable to an XSS attack as detailed in issue 171. As a result, all previous versions have been removed from PyPI to prevent users from installing insecure versions. All users are urged to upgrade as soon as possible.

Checklist

Put an x in the bracket when you have completed each task, like this: [x]

Steps to reproduce

Actual behavior

Expected behavior

basilrabi commented 6 years ago

In the branch js-unlinting-fixes in admin page, the 1st chained foreign key which is dependent on a foreign key is rendered correctly for me. However, the 2nd-degree (or more) chained foreign key field, which is dependent on the 1st chained foreign key field, is not rendered correctly. If the 2nd-degree (or more) chained foreign key field was previously edited or has a previously set data-value before loading the admin page, what is being rendered is the empty option and not the previously-set value.

260 fixes this issue for me.

shaistha25 commented 6 years ago

I'm using ChainedForeignKey for admin page. The values in the 2nd drop-down is not rendered at all. When I set 'show_all=True', then all the values (unfiltered) are rendered. What is the fix?

basilrabi commented 6 years ago

Are you using js-unlinting-fixes branch?

shaistha25 commented 6 years ago

I did pip install 'git+https://github.com/digi604/django-smart-selects.git@js-unlinting-fixes' and even an upgrade from issue#253 solution. I also did 'collect static' and added the chainedfk.js(), chainedm2m.js() to the Base.html of my admin template. Finally works like charm with IE and Firefox. But with Chrome it's the never ending error 'Uncaught ReferenceError: chainedfk is not defined' at line12 of bindfields.js. Nevertheless, javascript is enabled in chrome.

manelclos commented 4 years ago

@ofathy can you reproduce with latest master version?

manelclos commented 3 years ago

Closing due to inactivity