6π
Hereβs how I solved this, for some reason unknown to me, a file called chainedfk.js is missing. After a little digging I found that this file exists in this path βsmart-selects/admin/js/chainedfk.jsβ in the library files.
So I simply added this import line my base.html file.
*I removed the tags so it can be visible.
script src=β{% static βsmart-selects/admin/js/chainedfk.jsβ %}β
after the js import line and it worked like a charm π
2π
UPDATE β MAY- 2017
Sorry, things have a bit changed as of now, my form also refused to load and yet it was loading some time back, so you have to include the tag below, right after the jquery and the tag that contains chainedfk.js
This works very well both for django 1.10.5 and Django 1.11 -(the latest version as of this writting) β Python 3.5.2
<script type="text/javascript" src="{% static 'smart-selects/admin/js/chainedfk.js' %}"></script>
<script type="text/javascript" src="{% static 'smart-selects/admin/js/chainedm2m.js' %}"></script>
<script type="text/javascript" src="{% static 'smart-selects/admin/js/bindfields.js' %}"></script>
- [Django]-ImportError: cannot import name <model_class>
- [Django]-Using Requests python library to connect Django app failed on authentication
- [Django]-Howto use django regular inheritance in models and forms
- [Django]-Failing fixture load: DoesNotExist: β¦ matching query does not exist
0π
I had the same problem but without receiving any error.
it worked for me too when I included:
<script src="{% static 'smart-selects/admin/js/chainedfk.js' %}"></script>
- [Django]-Difficulty installing Django Debug Toolbar
- [Django]-(django) static file for the whole project
- [Django]-Django {% blocktrans %}: How to handle pluralization inside a for loop?
- [Django]-Django admin StackedInline in custom tab
- [Django]-Django | twilio to send SMS
0π
to be 100% correct you have to import file with this specific order:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js </script>
<!-- Smart select -->
<script src="{% static 'smart-selects/admin/js/chainedfk.js' %}"></script>
<script src="{% static 'smart-selects/admin/js/chainedm2m.js' %}"></script>
- [Django]-How to use FilePond in Django project
- [Django]-MySQL Query error when run within Python but not when run directly
- [Django]-How to filter objects by price range in Django?
0π
Worked for me by putting {{form.media.js}}
which loads the required javascripts in the head.
so:
{% block headjavascript %}{{ form.media.js }}{% endblock %}
Which is a better practice for loading javascript
- [Django]-Missing mysql.sock; yielding OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")
- [Django]-Django [Mezzanine CMS] project not deploying to Heroku
- [Django]-Single django app to use multiple sqlite3 files for database
- [Django]-Dealing with legacy django project in new localized projects
- [Django]-How to update where the files are stored in Django app