我正在使用django_smart_select包。我正在嘗試使用鏈式選擇選項的模型中出現以下錯誤。Django admin:'bool'對象沒有屬性'startswith'
AttributeError at /admin/tags/tag/add/
'bool' object has no attribute 'startswith'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/tags/tag/add/
Django Version: 1.11.4
Exception Type: AttributeError
Exception Value:
'bool' object has no attribute 'startswith'
Error during template rendering
In template C:\Users\gautammandewalker\Envs\django01\lib\site-
packages\django\contrib\admin\templates\admin\base.html, error at line 3
'bool' object has no attribute 'startswith'
1 {% load i18n static %}<!DOCTYPE html>
2 {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi
as LANGUAGE_BIDI %}
3 <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI
%}dir="rtl"{% endif %}>
4 <head>
5 <title>{% block title %}{% endblock %}</title>
6 <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{%
static "admin/css/base.css" %}{% endblock %}" />
7 {% block extrastyle %}{% endblock %}
8 {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{%
block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{%
endif %}
9 {% block extrahead %}{% endblock %}
10 {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{%
endblock %}
11 </head>
12 {% load i18n %}
歡迎堆棧溢出!如果你可以發佈你的代碼,這是首選。這樣,它可以幫助人們回答你的問題。謝謝! – MarceloBarbosa