11flask-inputfilter
22==================================
33
4- The `InputFilter ` class is used to validate and filter input data in Flask applications.
4+ The `` InputFilter ` ` class is used to validate and filter input data in Flask applications.
55It provides a modular way to clean and ensure that incoming data meets expected format
66and type requirements before being processed.
77
8+ .. raw :: html
9+
10+ <div style =" border :1px solid #86989B ;padding :1rem ;border-radius :3px ;background-color :#f7f7f7 ;" >
11+ <p style =" background-color :hsl (219.5 , 84% , 90% );margin :-1rem -1rem 0.8rem -1rem ;padding :0.3rem 1rem 0.3rem 2.5rem ;position :relative ;border-radius :3px 3px 0 0 ;" >
12+ <span style =" content :' ' ;position :absolute ;top :.25rem ;left :.5rem ;width :1.5rem ;height :1.5rem ;background-color :hsl (219.5 , 84% , 50% );mask-image :url (' data:image/svg+xml;charset=utf-8,<svg xmlns= " http: //www.w3.org /2000 /svg " viewBox=" 0 0 24 24 " ><path d=" M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z " /></svg>');" ></span >
13+ Tip
14+ </p >
15+ <p style =" margin :0 ;" >
16+ Thank you for using <code >flask-inputfilter</code >!<br >
17+ If you have any questions or suggestions, please feel free to open an issue on GitHub <a href =" https://github.com/LeanderCS/flask-inputfilter" >here</a >.<br >
18+ If you don't want to miss any updates, please star the repository.<br >
19+ This will help me to understand how many people are interested in this project.<br >
20+ </p >
21+ </div >
22+
23+ .. raw :: html
24+
25+ <div style =" border :1px solid #86989B ;padding :1rem ;border-radius :3px ;background-color :#f7f7f7 ;" >
26+ <p style =" background-color :hsl (150 , 36.7% , 90% );margin :-1rem -1rem 0.8rem -1rem ;padding :0.3rem 1rem 0.3rem 2.5rem ;position :relative ;border-radius :3px 3px 0 0 ;" >
27+ <span style =" content :' ' ;position :absolute ;top :.25rem ;left :.5rem ;width :1.5rem ;height :1.5rem ;background-color :hsl (150 , 36.7% , 50% );mask-image :url (' data:image/svg+xml;charset=utf-8,<svg xmlns= " http: //www.w3.org /2000 /svg " viewBox=" 0 0 24 24 " ><path d=" M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z " /></svg>');" ></span >
28+ Hint
29+ </p >
30+ <p style =" margin :0 ;" >
31+ For information about the usage you can view the documentation
32+ </p >
33+ </div >
34+
835:Test Status:
936
1037 .. image :: https://img.shields.io/github/actions/workflow/status/LeanderCS/flask-inputfilter/test.yaml?branch=main&style=flat-square&label=Github%20Actions
@@ -37,10 +64,10 @@ Installation
3764 Quickstart
3865==========
3966
40- To use the `InputFilter ` class, create a new class that inherits from it and define the
67+ To use the `` InputFilter ` ` class, create a new class that inherits from it and define the
4168fields you want to validate and filter.
4269
43- There are numerous filters and validators available, but you can also create your `own <CREATE_OWN .md >`_.
70+ There are numerous filters and validators available, but you can also create your `own <CreateOwn .md >`_.
4471
4572Definition
4673----------
@@ -92,8 +119,8 @@ Definition
92119 Usage
93120-----
94121
95- To use the `InputFilter ` class, call the `validate ` method on the class instance.
96- After calling `validate `, the validated data will be available in `g.validated_data `.
122+ To use the `` InputFilter `` class, call the `` validate ` ` method on the class instance.
123+ After calling `` validate `` , the validated data will be available in `` g.validated_data ` `.
97124If the data is invalid, a 400 response with an error message will be returned.
98125
99126.. code-block :: python
@@ -112,33 +139,17 @@ If the data is invalid, a 400 response with an error message will be returned.
112139 id = data.get(' id' )
113140 zipcode = data.get(' zipcode' )
114141
115- Options
116- =======
117-
118- The `add ` method supports several options:
119-
120- - `Required `_
121- - `Filter <flask_inputfilter/Filter/README.md >`_
122- - `Validator <flask_inputfilter/Validator/README.md >`_
123- - `Default `_
124- - `Fallback `_
125- - `ExternalApi <EXTERNAL_API.md >`_
126-
127- Required
128- --------
129-
130- The `required ` option specifies whether the field must be included in the input data.
131- If the field is missing, a `ValidationError ` will be raised with an appropriate error message.
132-
133- Default
134- -------
135142
136- The `default ` option allows you to specify a default value to use if the field is not
137- present in the input data.
143+ .. raw :: html
138144
139- Fallback
140- --------
145+ <div style =" border :1px solid #86989B ;padding :1rem ;border-radius :3px ;background-color :#f7f7f7 ;" >
146+ <p style =" background-color :hsl (150 , 36.7% , 90% );margin : -1rem -1rem 0.8rem -1rem ;padding :0.3rem 1rem 0.3rem 2.5rem ;position :relative ;border-radius :3px 3px 0 0 ;" >
147+ <span style =" content :' ' ;position :absolute ;top :.25rem ;left :.5rem ;width :1.5rem ;height :1.5rem ;background-color :hsl (150 ,36.7% ,50% );mask-image :url (' data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>' );" ></span >
148+ Tip
149+ </p >
150+ <p style =" margin :0 ;" >
151+ For further instructions please view the documentary `Here <https: //github.com /LeanderCS /flask-inputfilter. <br >
141152
142- The ` fallback ` option specifies a value to use if validation fails or required data
143- is missing. Note that if the field is optional and absent, ` fallback ` will not apply;
144- use ` default ` in such cases.
153+ For ideas, suggestions or questions, please open an issue on GitHub < a href = " https://github.com/LeanderCS/flask-inputfilter " >here</ a >.
154+ </ p >
155+ </ div >
0 commit comments