如何添加某些模型的范圍基礎(chǔ) ORM?from .models import UsersLogif request.method == 'POST': login = request.POST.get('flogin') response_data = {} response_data['result'] = 'Failed' lengthBase = UsersLog.objects.get() for i in lengthBase: // I got 3 users so I want lengthBase equal 3
1 回答

波斯汪
TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超4個(gè)贊
如果您想遍歷用戶日志,請(qǐng)嘗試lengthBase = UsersLog.objects.all()
.
或者,如果您只想獲取用戶日志的數(shù)量,請(qǐng)嘗試
lengthBase = UsersLog.objects.count() for i in range(lengthBase):
添加回答
舉報(bào)
0/150
提交
取消