From f3a010946998e5890b75f8a523f3d9fb3a62fb04 Mon Sep 17 00:00:00 2001 From: pmg-certn <112716746+pmg-certn@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:13:36 +0000 Subject: [PATCH] Rename `age_pair` to `age` to use more standard readers naming convention --- docs/explanation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/explanation.md b/docs/explanation.md index f5b75ed..63be8cf 100644 --- a/docs/explanation.md +++ b/docs/explanation.md @@ -169,7 +169,7 @@ Note above that the second argument to `producers.relationship` is a projector f In the example used above, the `produce_age` producer depends on the `birth_year` field: ```python -age_pair = (qs.include_fields("birth_year"), produce_age) +age = (qs.include_fields("birth_year"), produce_age) ``` `django-readers` includes [some useful functions that create pairs](reference/pairs.md). These attempt to generate the most efficient queries they can, which means loading only those database fields required to produce the value or values: @@ -199,7 +199,7 @@ Relationships can automatically be loaded and projected, too: ```python prepare, project = pairs.combine( pairs.producer_to_projector("name", pairs.field("name")), - pairs.producer_to_projector("age", age_pair), + pairs.producer_to_projector("age", age), pairs.producer_to_projector( "book_set", pairs.relationship( @@ -234,7 +234,7 @@ from django_readers import specs spec = [ "name", - {"age": age_pair}, + {"age": age}, { "book_set": [ "title",