会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
守护式等待
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
2019年10月16日
url中的20%、22%、26%、28%、29%怎么解析还原成真实的字符
摘要:
阅读全文
posted @ 2019-10-16 18:25 守护式等待
阅读(166)
评论(0)
推荐(0)
django update_or_create
摘要: update_or_create question.votes.update_or_create(user=request.user, defaults={"value": value}) # user 为查询条件 # defaults 中的数据如果存着就更新, 不存着就创建这条数据
阅读全文
posted @ 2019-10-16 15:09 守护式等待
阅读(23)
评论(0)
推荐(0)
django获取某一个字段的列表 values values_list flat=true
摘要: 1.values() print(Question.objects.values('title')) #得到的是一个字典 <QuestionQuerySet [{'title': '查询优化之select_related与prefetch_related - 简书'}, {'title': '你们都
阅读全文
posted @ 2019-10-16 15:03 守护式等待
阅读(209)
评论(0)
推荐(0)
Django之ContentType,GenericRelation, GenericForeignKey
摘要: contenttypes 是Django内置的一个应用,可以追踪项目中所有app和model的对应关系,并记录在ContentType表中。 models.py文件的表结构写好后,通过makemigrations和migrate两条命令迁移数据后,在数据库中会自动生成一个django_content
阅读全文
posted @ 2019-10-16 13:46 守护式等待
阅读(182)
评论(0)
推荐(0)