不返回QUERY SET
一类是create, update, delete, exist 这种。按行为目的就不需要返回数据的。
一类是 返回的不是tuple,比如 count(), max() 这些。
另一类是 get(), first(), last(), get_or_create(), 这些返回的model object, 而不是query set. 我的理解就是他们是返回model对象本身,就不用queryset
get_or_create(主键-唯一字段,default={})
主键写在外面
Meta-> get_latest_by = "created_at" 按照时间来排序
这个修改不用表操作
不返回queryAPI
1.获取对象get(),get_or_create(),frist(),last(),latest(),earliest(),in_bulk()
2.创建对象create(),bulk_create(),create_or_updata()创建,批量创建,创建或更新
3.更新对象updata()updata_or_create()更新,更新或创建
4.删除对象delete()使用filte过滤
5其他操作exists(),count(),aggrrgate()判断是否存在,统计个数,聚合