我只需要返回属于当前所选国家的城市。
知道我该怎么做吗?
我知道我需要使用 JavaScript 来更新列表,但我如何才能为初始请求执行此操作,因为我正在使用:{{ profile_form.city }} 在我的视图中加载整个字段
City 模型有一个 Country 的外键。
您的帮助将不胜感激。
Check this app, sure it will help you a lot, and can save you a lot of time https://github.com/dpnova/django-simple-cities.