@@ -30,7 +30,7 @@ Now we can customize our page.
30
30
If you want to change default name of page class, you should use ` UseName ` customizer:
31
31
32
32
``` py
33
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:17 - 21 ]!}
33
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:18 - 22 ]!}
34
34
```
35
35
36
36
1 . 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
47
47
If you want to change this behavior, you should use ` UseIncludeTotal ` customizer:
48
48
49
49
``` py
50
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:22 - 26 ]!}
50
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:23 - 27 ]!}
51
51
```
52
52
53
53
1 . 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
57
57
If you want to change default values of pagination parameters, you should use ` UseParamsFields ` customizer:
58
58
59
59
``` py
60
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:27 - 31 ]!}
60
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:28 - 32 ]!}
61
61
```
62
62
63
63
1 . 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
68
68
If you want to change type of pagination parameters, you should use ` UseParams ` customizer:
69
69
70
70
``` py
71
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:32 - 36 ]!}
71
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:33 - 37 ]!}
72
72
```
73
73
74
74
1 . Now all pagination parameters will be optional.
@@ -79,7 +79,7 @@ If you want to change type of pagination parameters, you should use `UseParams`
79
79
If you want use another name of field rather than default, you should use ` UseFieldsAliases ` customizer:
80
80
81
81
``` py
82
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:46 - 50 ]!}
82
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:47 - 51 ]!}
83
83
```
84
84
85
85
1 . 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
90
90
If you want to exclude some fields from serialization, you should use ` UseExcludedFields ` customizer:
91
91
92
92
``` py
93
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:51 - 55 ]!}
93
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:52 - 56 ]!}
94
94
```
95
95
96
96
1 . Now ` total ` field will not be serialized.
@@ -101,7 +101,7 @@ If you want to exclude some fields from serialization, you should use `UseExclud
101
101
If you want to change pydantic model config, you should use ` UseModelConfig ` customizer:
102
102
103
103
``` py
104
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:56 - 60 ]!}
104
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:57 - 61 ]!}
105
105
```
106
106
107
107
1 . 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
112
112
If you want to change type of page parameters, you should use ` UseParams ` customizer:
113
113
114
114
``` py
115
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:38 - 46 ]!}
115
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:39 - 47 ]!}
116
116
```
117
117
118
118
1 . 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
123
123
You can use multiple customizers at once, just pass them as to regular ` Annotated ` :
124
124
125
125
``` py
126
- {!../ docs_src/ tutorials_advanced/ customization.py [ln:62 - 68 ]!}
126
+ {!../ docs_src/ tutorials_advanced/ customization.py [ln:63 - 69 ]!}
127
127
```
128
128
129
129
1 . Now ` CustomPage ` will have ` CustomPage ` name, no total count of items, all params optional.
0 commit comments