我想检查登录的用户是医生还是患者,我尝试了以下方法来检查该东西,但没有成功可以帮助我。
或此错误是什么意思:
Could not parse the remainder: '=='Doctor'' from 'user.user_type=='Doctor''
答案 0 :(得分:0)
确保==
周围有空格。应该是user.user_type == 'Doctor'
而不是user.user_type=='Doctor'
好像您在index.html中也有错字。
将user.user_type=='Pateint'
更改为user.user_type == 'Patient'
。请注意==
周围的空格。
答案 1 :(得分:0)
使用this,因为制表符是字符串形式的%s
user.user_type == 'Doctor'
user.user_type == 'Patient'