Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 117 for custom (0.18 sec)

  1. docs/en/docs/advanced/custom-response.md

    ```Python hl_lines="2  10"
    {!../../../docs_src/custom_response/tutorial009.py!}
    ```
    
    You can also use the `response_class` parameter:
    
    ```Python hl_lines="2  8  10"
    {!../../../docs_src/custom_response/tutorial009b.py!}
    ```
    
    In this case, you can return the file path directly from your *path operation* function.
    
    ## Custom response class
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  2. docs/em/docs/how-to/custom-request-and-route.md

    ```Python hl_lines="13  15"
    {!../../../docs_src/custom_request_and_route/tutorial002.py!}
    ```
    
    🚥 ⚠ 📉, `Request` 👐 🔜 ↔, 👥 💪 ✍ & ⚒ ⚙️ 📨 💪 🕐❔ 🚚 ❌:
    
    ```Python hl_lines="16-18"
    {!../../../docs_src/custom_request_and_route/tutorial002.py!}
    ```
    
    ## 🛃 `APIRoute` 🎓 📻
    
    👆 💪 ⚒ `route_class` 🔢 `APIRouter`:
    
    ```Python hl_lines="26"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  3. fastapi/encoders.py

        [FastAPI docs for JSON Compatible Encoder](https://fastapi.tiangolo.com/tutorial/encoder/).
        """
        custom_encoder = custom_encoder or {}
        if custom_encoder:
            if type(obj) in custom_encoder:
                return custom_encoder[type(obj)](obj)
            else:
                for encoder_type, encoder_instance in custom_encoder.items():
                    if isinstance(obj, encoder_type):
                        return encoder_instance(obj)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  4. tests/test_jsonable_encoder.py

    
    def test_custom_enum_encoders():
        def custom_enum_encoder(v: Enum):
            return v.value.lower()
    
        class MyEnum(Enum):
            ENUM_VAL_1 = "ENUM_VAL_1"
    
        instance = MyEnum.ENUM_VAL_1
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={MyEnum: custom_enum_encoder}
        )
        assert encoded_instance == custom_enum_encoder(instance)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  5. analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/annotations/KtFirAnnotationListForType.kt

                }
            }
        }
    }
    
    private fun ConeKotlinType.customAnnotationsWithLazyResolve(phase: FirResolvePhase): List<FirAnnotation> {
        val custom = attributes.custom ?: return emptyList()
        val annotations = custom.annotations.ifEmpty { return emptyList() }
    
        for (annotation in annotations) {
            val containerSymbol = (annotation as? FirAnnotationCall)?.containingDeclarationSymbol ?: continue
    Plain Text
    - Registered: Fri Apr 26 08:18:10 GMT 2024
    - Last Modified: Thu Apr 25 07:15:56 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  6. fastapi/routing.py

                Type[APIRoute],
                Doc(
                    """
                    Custom route (*path operation*) class to be used by this router.
    
                    Read more about it in the
                    [FastAPI docs for Custom Request and APIRoute class](https://fastapi.tiangolo.com/how-to/custom-request-and-route/#custom-apiroute-class-in-a-router).
                    """
                ),
            ] = APIRoute,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  7. docs/en/docs/reference/responses.md

    # Custom Response Classes - File, HTML, Redirect, Streaming, etc.
    
    There are several custom response classes you can use to create an instance and return them directly from your *path operations*.
    
    Read more about it in the [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
    
    You can import them directly from `fastapi.responses`:
    
    ```python
    from fastapi.responses import (
        FileResponse,
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  8. docs/metrics/prometheus/grafana/bucket/minio-bucket.json

            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisBorderShow": false,
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
    Json
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 15 10:03:01 GMT 2024
    - 102K bytes
    - Viewed (0)
  9. cmd/xl-storage-disk-id-check.go

    	return madmin.TraceInfo{
    		TraceType: madmin.TraceStorage,
    		Time:      startTime,
    		NodeName:  globalLocalNodeName,
    		FuncName:  "storage." + s.String(),
    		Duration:  duration,
    		Path:      path,
    		Error:     err,
    		Custom:    custom,
    	}
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 33K bytes
    - Viewed (0)
  10. fastapi/applications.py

                Doc(
                    """
                    The default response class to be used.
    
                    Read more in the
                    [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/#default-response-class).
    
                    **Example**
    
                    ```python
                    from fastapi import FastAPI
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
Back to top