标签:div cep tle try django log code exe color
分别返回queryset的第一项与最后一项,具体用法如下:
p = Blog.objects.order_by(‘title‘).first()
等同于:
try: p = Blog.objects.order_by(‘title‘)[0] except IndexError: p = None
标签:div cep tle try django log code exe color
原文地址:https://www.cnblogs.com/hooo-1102/p/12078344.html