I want to have chained foreign key in my django-admin and thus I am using django-smart-selects. I have followed the documentation properly
- Install django-smart-selects
- Add it in installed_apps in settings.py
- Add this line in my base urls.py
url(r'^chaining/', include('smart_selects.urls')),
- changed my model accordingly:
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)
and added this to my setting.py
JQUERY_URL = True
But everytime I try to create an address from admin, I get this error:-
if path.startswith(('http://', 'https://', '/')): AttributeError: 'bool' object has no attribute 'startswith'
How to solve this?