0
이것은 내 템플릿 코드입니다. view.py
에 입력 이름을 얻는 방법을 모르겠습니다. 어떻게해야합니까? 내가 당신을 이해한다면django 1.11 -보기에서 라디오 동적 이름을 얻는 방법?
{% for visitor in visitors %}
<label class="btn btn-secondary {% if visitor.is_vip == True %}active{% endif %}">
\t <input type="radio" name="{{visitor.face_id}}" value="vip" {% if visitor.is_vip == True %}checked{% endif %}> VIP
</label>
<label class="btn btn-secondary {% if visitor.is_black == True %}active{% endif %}">
\t <input type="radio" name="{{visitor.face_id}}" value="black" {% if visitor.is_black == True %}checked{% endif %} > Black
</label>
<label class="btn btn-secondary {% if visitor.is_vip != True and visitor.is_black != True %}active{% endif %}">
\t <input type="radio" name="{{visitor.face_id}}" value="guest" {% if visitor.is_vip != True and visitor.is_black != True %}checked{% endif %} > Guest
</label>
{% endfor %}