@@ -30,7 +30,7 @@ Now we can customize our page.
3030If you want to change default name of page class, you should use ` UseName ` customizer:
3131
3232``` py
33- {!../ docs_src/ tutorials_advanced/ customization.py [ln:17 - 21 ]!}
33+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:18 - 22 ]!}
3434```
3535
36361 . Now your class will be names 'IntPage' instead of 'CustomizedPage'.
@@ -47,7 +47,7 @@ By default, cursor-based page don't include total count of items, and offset-bas
4747If you want to change this behavior, you should use ` UseIncludeTotal ` customizer:
4848
4949``` py
50- {!../ docs_src/ tutorials_advanced/ customization.py [ln:22 - 26 ]!}
50+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:23 - 27 ]!}
5151```
5252
53531 . Now when you will paginate using ` PageNoTotal ` class, it will not include total count of items.
@@ -57,7 +57,7 @@ If you want to change this behavior, you should use `UseIncludeTotal` customizer
5757If you want to change default values of pagination parameters, you should use ` UseParamsFields ` customizer:
5858
5959``` py
60- {!../ docs_src/ tutorials_advanced/ customization.py [ln:27 - 31 ]!}
60+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:28 - 32 ]!}
6161```
6262
63631 . Now when ` size ` parameter is not provided, it will be equal to 500.
@@ -68,7 +68,7 @@ If you want to change default values of pagination parameters, you should use `U
6868If you want to change type of pagination parameters, you should use ` UseParams ` customizer:
6969
7070``` py
71- {!../ docs_src/ tutorials_advanced/ customization.py [ln:32 - 36 ]!}
71+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:33 - 37 ]!}
7272```
7373
74741 . Now all pagination parameters will be optional.
@@ -79,7 +79,7 @@ If you want to change type of pagination parameters, you should use `UseParams`
7979If you want use another name of field rather than default, you should use ` UseFieldsAliases ` customizer:
8080
8181``` py
82- {!../ docs_src/ tutorials_advanced/ customization.py [ln:46 - 50 ]!}
82+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:47 - 51 ]!}
8383```
8484
85851 . Now ` total ` field will be serialized as ` count ` .
@@ -90,7 +90,7 @@ If you want use another name of field rather than default, you should use `UseFi
9090If you want to exclude some fields from serialization, you should use ` UseExcludedFields ` customizer:
9191
9292``` py
93- {!../ docs_src/ tutorials_advanced/ customization.py [ln:51 - 55 ]!}
93+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:52 - 56 ]!}
9494```
9595
96961 . Now ` total ` field will not be serialized.
@@ -101,7 +101,7 @@ If you want to exclude some fields from serialization, you should use `UseExclud
101101If you want to change pydantic model config, you should use ` UseModelConfig ` customizer:
102102
103103``` py
104- {!../ docs_src/ tutorials_advanced/ customization.py [ln:56 - 60 ]!}
104+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:57 - 61 ]!}
105105```
106106
1071071 . Now ` Page ` class will have ` anystr_lower ` set to ` True ` .
@@ -112,7 +112,7 @@ If you want to change pydantic model config, you should use `UseModelConfig` cus
112112If you want to change type of page parameters, you should use ` UseParams ` customizer:
113113
114114``` py
115- {!../ docs_src/ tutorials_advanced/ customization.py [ln:38 - 46 ]!}
115+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:39 - 47 ]!}
116116```
117117
1181181 . Now ` Page.__params_type__ ` attribute will be point to ` MyParams ` class.
@@ -123,7 +123,7 @@ If you want to change type of page parameters, you should use `UseParams` custom
123123You can use multiple customizers at once, just pass them as to regular ` Annotated ` :
124124
125125``` py
126- {!../ docs_src/ tutorials_advanced/ customization.py [ln:62 - 68 ]!}
126+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:63 - 69 ]!}
127127```
128128
1291291 . Now ` CustomPage ` will have ` CustomPage ` name, no total count of items, all params optional.
0 commit comments