Django dependent select

前端 未结 3 737
青春惊慌失措
青春惊慌失措 2020-12-03 11:58

I know that there is a lot of answers on this question, but i am new in Django and i dont know how to implement these solutions. First what i want to do. This is my models:<

3条回答
  •  生来不讨喜
    2020-12-03 12:42

    You can use Jquery plugin chained.

    Example: http://codepen.io/anon/pen/EapNPo?editors=101

    HTML

    
    
    

    js

    $("#id_city").chained("#id_country");
    

    Generate form with models (ForeignKey)

    Go to https://axiacore.com/blog/django-y-selects-encadenados/ complete tutorial

提交回复
热议问题