def blog(request):
"""目录
1.查询方法:filter(),get(),all(),exclude()[和filter()相反]...
2.条件过滤器:__exact,__iexact,__contains,__in,__range......
2.1.ForeignKey查询
2.2.多值查询
2.3.ManyToManyField查询
3.查询过滤器:first(),last(),exists(),order_by(),values()...
4.聚合查询:Avg(),Max(),Min(),Sum(),count(),
Student.objects.aggregate(Max('age')) # 学生中年龄最大的一个
在模板中使用<h1>欢迎 {{ stus.age__max }} 光临python自学网</h1>来处理最终数据
5.操作集合:create(),add(),remove(),update(),delete(),clear(),save()...
6.Q和F对象使用
https://blog.csdn.net/weixin_45451320/article/details/124826361
https://docs.djangoproject.com/zh-hans/4.0/topics/db/queries/#field-lookups
7.模型实例比较
8.shell模式中运行python代码
9.接口参数处理:https://blog.csdn.net/weixin_47008635/article/details/115409596
"""
"""1.查询方法"""
# print(Article_List.objects.all()) # 返回所有数据
# print(type(Article_List.objects.all()))
#
# print(Article_List.objects.get(id=1)) # 根据条件返回一条数据,有且只能返回一条
# print(type(Article_List.objects.get(id=1)))
#
# print(Article_List.objects.filter(id__lt=3), '1111111111') # 根据条件返回一条或多条数据
# print(type(Article_List.objects.filter(id__lt=3)))
#
# print(Article_List.objects.exclude(id__lt=3)) # 根据条件返回一条或多条数据
# print(type(Article_List.objects.exclude(id__lt=3)))