Django 5.1 Documentationthe following query: >>> Book.objects.annotate(num_authors=Count("authors")).order_by("num_autho rs") values() Ordinarily, annotations are generated on a per-object basis - an annotated QuerySet will author', 'entries': 33}]> >>> Blog.objects.values(entry__authors__name__lower=Lower("entry__autho rs__name")).annotate( ... entries=Count("entry") ... )0 码力 | 3513 页 | 3.17 MB | 1 年前3
Django 5.1.2 Documentationthe following query: >>> Book.objects.annotate(num_authors=Count("authors")).order_by("num_autho rs") values() Ordinarily, annotations are generated on a per-object basis - an annotated QuerySet will author', 'entries': 33}]> >>> Blog.objects.values(entry__authors__name__lower=Lower("entry__autho rs__name")).annotate( ... entries=Count("entry") ... )0 码力 | 3519 页 | 3.17 MB | 1 年前3
Django 5.0.x Documentationthe following query: >>> Book.objects.annotate(num_authors=Count("authors")).order_by("num_autho rs") values() Ordinarily, annotations are generated on a per-object basis - an annotated QuerySet will author', 'entries': 33}]> >>> Blog.objects.values(entry__authors__name__lower=Lower("entry__autho rs__name")).annotate( ... entries=Count("entry") ... )0 码力 | 3407 页 | 3.21 MB | 1 年前3共 3 条- 1













