假如我有代码如下:
from django.contrib.auth.models import User
us = User.objects.all()# 我想要获取所有用户的 id,is_activev1 = us.values("id", "is_active")# 现在我想要在结果里面加入一个其他字段(原 User 里面没有),如: other='hehe'# [{"id": 1, "is_active": True, "other": "hehe"}, ...]v1 = us.values("id", "is_active", other="hehe") # 这样是会报错的那么如何实现我要的结果呢???希望懂的人帮忙一下。
慕容3067478
慕斯709654
随时随地看视频慕课网APP