“int”对象在Django Temp上不可读取

2024-10-01 09:38:32 发布

您现在位置:Python中文网/ 问答频道 /正文

'int'对象不可编辑我在我的模板上得到了这个错误,我明白,我想这是什么意思-条件:{% elif User_No_Auth_Tld > 0 %}不能允许for()循环遍历结果({% for NotAuthDomain in User_No_Auth_Tld %}),但我尝试了:{% elif User_No_Auth_Tld %}(没有整数条件),但仍然得到相同的错误。在

我到底做错了什么?在

谢谢你

{% if not User_Tld_Entered  %}  <!-- show ADD TLD form -->      
    <hr />
    #form here
    <br />
    <h4>Verify your domain</h4>

{% elif User_No_Auth_Tld > 0 %}

    <h1>display unauth domains, with auth link</h1>
        {% for NotAuthDomain in User_No_Auth_Tld %}
            {{ NotAuthDomain }}
        {% endfor %}
{% elif User_Auth_Tld %}
   #form here.
{% endif %}

对于将来可能会浏览此帖子寻求帮助的用户: 最后,我更改了User_No_Auth_Tld的声明,使其不对db记录使用.count()方法。在


Tags: noinformauthforhere错误条件