开发者

Django object / Sql problem

I am just beginning to use Django, and I am ha开发者_如何学运维ving problems.

I would like to translate the following SQL:

SELECT id FROM modelName WHERE email=request.form['email']

into Django object code

uid = modelName.objects.(whatever goes in here) 

Thanks in advance


The SQL query returns a list of id. Here is the Django version:

list_id = modelClass.objects.filter(email=request.form['email']).values_list('id', flat=True)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜