Closed bgarcial closed 3 years ago
A few questions:
form_profiles
template context variable what you expect it to be?/static/smart-selects/admin/js/bindfields.js
on your problematic page?/static/smart-selects/admin/js/bindfields.js
on your admin page?I suspect that your problematic page is not loading the bindfields.js
file (probably due to a bug in django-smart-selects), which is causing the form to not be initialized for smart selecting.
If you manually include these three pieces of JS in your template with <script src="">
tags (in this order):
/static/smart-selects/admin/js/chainedfk.js
/static/smart-selects/admin/js/chainedm2m.js
/static/smart-selects/admin/js/bindfields.js
does your problematic page work properly?
Hey @bgarcial, did you ever get this working, or are you still having issues?
Hi @blag in this moment I don't test about it. Can you have this issue open determined time more please? What has happened to me is that I don't had that use django-smart-select in that momento and then I have again to test this behaviour from scratch ...
@bgarcial Yes, I’ll leave the issue open until somebody can test it. No worries. :smiley:
I've tried the above mentioned solution but it ain't working either. I'm using django 2.1.5 and python 3.7 And using the JSLint Branch since the master branch doesn't work either
@bgarcial can you reproduce with latest master version?
Closing due to inactivity.
Checklist
Put an
x
in the bracket when you have completed each task, like this:[x]
[x] This issue is not about installing previous versions of django-smart-selects older than 1.2.8. I understand that previous versions are insecure and will not receive any support whatsoever.
[x] I have verified that that issue exists against the
master
branch of django-smart-selects.[ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate. There is some similar issues, but I cannot setup if them are duplicate. For this reason, I don't check here the option despite I've searched. My apologies just in case
This issue is similar, but in their case, happens the same problem to me but in the admin area. My problem is in my frontend application using
forms.ModelForm
[ ] I have debugged the issue to the
smart_selects
app. In my command line interface, I cannot view the http requests events in relation to my issue. I know how to use some things like ipdb, but unknow how to use in this situation due todjango-smart-selects
work internally in this chaining scenario[x] I have reduced the issue to the simplest possible case. Yes, I guess that below in my description, the issue is enoughly clear
[x] I have included all relevant sections of
models.py
,forms.py
, andviews.py
with problems.[x] I have used GitHub Flavored Markdown to style all of my posted code.
Steps to reproduce
1. My models
I have the following models: In
StudiesTypeOffered
model I have some type of studies, in the fieldname
.And I have the
StudiesOffertList
model, which have an studies offert list asociated to studies type in my parent model aboveIn my
StudyHostProfile
model. which is the model that meet to previous models, I have:studies_type_offered
is my parent fieldstudies_offert_list
is my child field2. My forms.py file
I am rendering the following field in my forms.py
3. My views.py
**4. My
profile_form.html
templateIn my urls.py I have this
Actual behavior
In my frontend application the current behavior is:
In my django-console do not happen any http GET requests
Expected behavior
The expected behavior is when I choose some option in my
studies_type_offered
parent field, in thestudies_offert_list
child field appear some options according to the previous selection.Curiously in my admin section in Django, this expected behavior is accomplished. Worrks Ok
This is the traceback http requests in my django console
Why the chaining works in django admin and in my django frontend application does not works? In a previous opportunity I can made this using
django-smart-selects==1.2.2
which currently is unsupported.My current packages are: