我想在django-admin中链接外键,因此我正在使用django-smart-selects。 我已经正确遵循了文档
url(r'^chaining/', include('smart_selects.urls')),
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)
并将其添加到我的设置中。py
JQUERY_URL = True
但是每次我尝试从管理员创建地址时,都会出现此错误:-
如果path.startswith(('http://','https://','/')): AttributeError:“ bool”对象没有属性“ startswith”
如何解决这个问题?
答案 0 :(得分:1)
在设置中使用 USE_DJANGO_JQUERY = True 代替 JQUERY_URL = True 。