django-smart-selects无法正常工作

问题描述 投票:0回答:1

我想在django-admin中链接外键,因此我正在使用django-smart-selects。我正确地遵循了文档]

  1. 安装django-smart-selects
  2. 在settings.py的installed_apps中添加它
  3. 将此行添加到我的基本urls.py中
       url(r'^chaining/', include('smart_selects.urls')),
  1. 相应地更改了我的模型:
class AddressModel(BaseModel):
    country = models.ForeignKey(CountryModel, null=True, blank=True, on_delete=models.PROTECT)
    state = ChainedForeignKey(StateModel, chained_field=country, chained_model_field=country,
                              null=True, blank=True, on_delete=models.PROTECT)
    city = models.CharField(max_length=200, null=True, blank=True)

并将其添加到我的setting.py

JQUERY_URL = True

但是每次我尝试从管理员创建地址时,都会出现此错误:-

如果path.startswith(('http://','https://','/')):AttributeError:“ bool”对象没有属性“ startswith”

如何解决?

python django django-models django-admin django-smart-selects
1个回答
0
投票
USE_DJANGO_JQUERY = True代替

JQUERY_URL = True。>

© www.soinside.com 2019 - 2024. All rights reserved.